import itertools
import arviz as az
import cmdstanpy
import pandas as pd
import numpy as np
from matplotlib import pyplot as pltNo entry for terminal type "xterm-color";
using dumb terminal settings.
Scientific knowledge often takes the form of specific relationships expressed by systems of equations. For example:
If there is an analytic solution to the equation system, we can just include the solution in our statistical model like any other form of structural knowledge: easy! However, often we want to solve equations that are hard or impossible to solve analytically, but can be solved approximately using numerical methods.
This is tricky in the context of Hamiltonian Monte Carlo for two reasons:
At every evaluation, the sampler needs to solve the embedded equation system and find the gradients of the solution with respect to all model parameters.
Reading:
Are equations that relate functions to their derivatives. Some examples of these functions are quantities such as (1) The volume of the liquid in a bioreactor over time \[ \frac{dV}{dt} = F_{in} - F_{out}. \] (2) The temperature of a steel rod with heat source at one end \[ \frac{dT}{dt} = \alpha \frac{d^{2}T}{dx^{2}}. \] (3) The concentration of a substrate in a bioreactor over time (example below). As mentioned previously, the solution to many of these sorts of differential equations does not have an algebraic solution, such as \(T(t) = f(x, t)\).
Arguably, the most simple type of differential equation is what is known as an ordinary differential equation. This means that there is only one independent parameter, typically this will be either time or a dimension. We will only consider ODEs for the remainder of the course.
To gain some intuition about what is going on we will investigate the height of an initially reactor over time with a constant flow rate into the reactor.
\[ \frac{dV}{dt} = F_{in} - F_{out} \] \[ \frac{dh}{dt} = \frac{F_{in} - F_{out}}{Area} \] \[ = \frac{0.1 - 0.02 * h}{1} (\frac{m^3}{min}) \]
This ODE is an example which can be manually integrated and has an analytic solution. We shall investigate how the height changes over time and what the steady state height is.
The first question is an example of an initial-value problem. Where we know the initial height (h=0), and we can solve the integral
\[ dh = \int_{t=0}^{t} 0.1 - 0.02*h dt. \] By using integrating factors (Don’t worry about this) we can solve for height \[ h = \frac{0.1}{0.02} + Ce^{-0.02t}. \] Finally, we can solve for the height by substituting what we know: at \(t = 0\), \(h = 0\). Therefore, we arrive at the final equation \[ h = \frac{0.1}{0.02}(1 - e^{-0.02t}). \]
We can answer the question about what its final height would be by solving for the steady-state
\[ \frac{dh}{dt} = 0. \]
Where after rearranging we find the final height equal to 5m, within the dimensions of the reactor
\[ h = \frac{0.1}{0.02} (m). \]
This is just a primer on differential equations. Solving differential equations using numerical solvers usually involves solving the initial-value problem, but rather than solving it analytically, a (hopefully stable) solver will increment the time and state values dependent on the rate equations. This is also an example of a single differential equation, however, we will investigate systems of equations as well.
We have some tubes containing a substrate \(S\) and some biomass \(C\) that we think approximately follow the Monod equation for microbial growth:
\[\begin{align*} \frac{dX}{dt} &= \frac{\mu_{max}\cdot S(t)}{K_{S} + S(t)}\cdot X(t) \\ \frac{dS}{dt} &= -\gamma \cdot \frac{\mu_{max}\cdot S(t)}{K_{s} + S(t)} \cdot X(t) \end{align*}\]
We measured \(X\) and \(S\) at different timepoints in some experiments and we want to try and find out \(\mu_{max}\), \(K_{S}\) and \(\gamma\) for the different strains in the tubes.
You can read more about the Monod equation in Allen and Waclaw (2019).
\(\mu_{max}, K_S, \gamma, S, X\) are non-negative.
\(S(0)\) and \(X(0)\) vary a little by tube.
\(\mu_{max}, K_S, \gamma\) vary by strain.
Measurement noise is roughly proportional to measured quantity.
We use two regression models to describe the measurements:
\[\begin{align*} y_X &\sim LN(\ln{\hat{X}}, \sigma_{X}) \\ y_S &\sim LN(\ln{\hat{S}}, \sigma_{S}) \end{align*}\]
To capture the variation in parameters by tube and strain we add a hierarchical regression model:
\[\begin{align*} \ln{\mu_{max}} &\sim N(a_{\mu_{max}}, \tau_{\mu_max}) \\ \ln{\gamma} &\sim N(a_{gamma}, \tau_{\gamma}) \\ \ln{\mu_{K_S}} &\sim N(a_{K_S}, \tau_{K_S}) \end{align*}\]
To get a true abundance given some parameters we put an ode in the model:
\[ \hat{X}(t), \hat{S}(t) = \text{solve-monod-equation}(t, X_0, S_0, \mu_max, \gamma, K_S) \]
In order to avoid doing too much annoying handling of strings we assume that all the parts of the problem have meaningful 1-indexed integer labels: for example, species 1 is biomass.
This code specifies the dimensions of our problem.
N_strain = 4
N_tube = 16
N_timepoint = 20
duration = 15
strains = [i+1 for i in range(N_strain)]
tubes = [i+1 for i in range(N_tube)]
species = [1, 2]
measurement_timepoint_ixs = [4, 7, 12, 15, 17]
timepoints = pd.Series(
np.linspace(0.01, duration, N_timepoint),
name="time",
index=range(1, N_timepoint+1)
)
SEED = 12345
rng = np.random.default_rng(seed=SEED)This code defines some true values for the parameters - we will use these to generate fake data.
true_param_values = {
"a_mu_max": -1.7,
"a_ks": -1.3,
"a_gamma": -0.6,
"t_mu_max": 0.2,
"t_ks": 0.3,
"t_gamma": 0.13,
"species_zero": [
[
np.exp(np.random.normal(-2.1, 0.05)),
np.exp(np.random.normal(0.2, 0.05))
] for _ in range(N_tube)
],
"sigma_y": [0.08, 0.1],
"ln_mu_max_z": np.random.normal(0, 1, size=N_strain).tolist(),
"ln_ks_z": np.random.normal(0, 1, size=N_strain).tolist(),
"ln_gamma_z": np.random.normal(0, 1, size=N_strain).tolist(),
}
for var in ["mu_max", "ks", "gamma"]:
true_param_values[var] = np.exp(
true_param_values[f"a_{var}"]
+ true_param_values[f"t_{var}"] * np.array(true_param_values[f"ln_{var}_z"])
).tolist()This code does some handy transformations on the data using pandas, giving us a table of information about the measurements.
tube_to_strain = pd.Series(
[
(i % N_strain) + 1 for i in range(N_tube) # % operator finds remainder
], index=tubes, name="strain"
)
measurements = (
pd.DataFrame(
itertools.product(tubes, measurement_timepoint_ixs, species),
columns=["tube", "timepoint", "species"],
index=range(1, len(tubes) * len(measurement_timepoint_ixs) * len(species) + 1)
)
.join(tube_to_strain, on="tube")
.join(timepoints, on="timepoint")
)This code puts the data in the correct format for cmdstanpy.
stan_input_structure = {
"N_measurement": len(measurements),
"N_timepoint": N_timepoint,
"N_tube": N_tube,
"N_strain": N_strain,
"tube": measurements["tube"].values.tolist(),
"measurement_timepoint": measurements["timepoint"].values.tolist(),
"measured_species": measurements["species"].values.tolist(),
"strain": tube_to_strain.values.tolist(),
"timepoint_time": timepoints.values.tolist(),
}This code defines some prior distributions for the model’s parameters
priors = {
# parameters that can be negative:
"prior_a_mu_max": [-1.8, 0.2],
"prior_a_ks": [-1.3, 0.1],
"prior_a_gamma": [-0.5, 0.1],
# parameters that are non-negative:
"prior_t_mu_max": [-1.4, 0.1],
"prior_t_ks": [-1.2, 0.1],
"prior_t_gamma": [-2, 0.1],
"prior_species_zero": [[[-2.1, 0.1], [0.2, 0.1]]] * N_tube,
"prior_sigma_y": [[-2.3, 0.15], [-2.3, 0.15]],
}The next bit of code lets us configure Stan’s interface to the Sundials ODE solver.
Now we can put all the inputs together
This code loads the Stan program at monod.stan as a CmdStanModel object and compiles it using cmdstan’s compiler.
functions {
real get_mu_at_t(real mu_max, real ks, real S_at_t) {
return (mu_max * S_at_t) / (ks + S_at_t);
}
vector ddt(real t, vector species, real mu_max, real ks, real gamma) {
real mu_at_t = get_mu_at_t(mu_max, ks, species[2]);
vector[2] out;
out[1] = mu_at_t * species[1];
out[2] = -gamma * mu_at_t * species[1];
return out;
}
}
data {
int<lower=1> N_measurement;
int<lower=1> N_timepoint;
int<lower=1> N_tube;
int<lower=1> N_strain;
array[N_measurement] int<lower=1, upper=N_tube> tube;
array[N_measurement] int<lower=1, upper=N_timepoint> measurement_timepoint;
array[N_measurement] int<lower=1, upper=2> measured_species;
vector<lower=0>[N_measurement] y;
array[N_tube] int<lower=1, upper=N_strain> strain;
array[N_timepoint] real<lower=0> timepoint_time;
array[N_tube, 2] vector[2] prior_species_zero;
array[2] vector[2] prior_sigma_y;
vector[2] prior_a_mu_max;
vector[2] prior_a_ks;
vector[2] prior_a_gamma;
vector[2] prior_t_mu_max;
vector[2] prior_t_gamma;
vector[2] prior_t_ks;
real<lower=0> abs_tol;
real<lower=0> rel_tol;
int<lower=1> max_num_steps;
int<lower=0, upper=1> likelihood;
}
parameters {
vector[N_strain] ln_mu_max_z;
vector[N_strain] ln_ks_z;
vector[N_strain] ln_gamma_z;
real a_mu_max;
real a_ks;
real a_gamma;
real<lower=0> t_mu_max;
real<lower=0> t_ks;
real<lower=0> t_gamma;
array[N_tube] vector<lower=0>[2] species_zero;
vector<lower=0>[2] sigma_y;
}
transformed parameters {
vector[N_strain] mu_max = exp(a_mu_max + ln_mu_max_z * t_mu_max);
vector[N_strain] ks = exp(a_ks + ln_ks_z * t_ks);
vector[N_strain] gamma = exp(a_gamma + ln_gamma_z * t_gamma);
array[N_tube, N_timepoint] vector[2] abundance;
for (tube_t in 1 : N_tube) {
abundance[tube_t] = ode_bdf_tol(ddt, species_zero[tube_t], 0,
timepoint_time,
abs_tol, rel_tol, max_num_steps,
mu_max[strain[tube_t]],
ks[strain[tube_t]], gamma[strain[tube_t]]);
}
}
model {
// priors
ln_mu_max_z ~ std_normal();
ln_ks_z ~ std_normal();
ln_gamma_z ~ std_normal();
a_mu_max ~ normal(prior_a_mu_max[1], prior_a_mu_max[2]);
a_ks ~ normal(prior_a_ks[1], prior_a_ks[2]);
a_gamma ~ normal(prior_a_gamma[1], prior_a_gamma[2]);
t_mu_max ~ lognormal(prior_t_mu_max[1], prior_t_mu_max[2]);
t_ks ~ lognormal(prior_t_ks[1], prior_t_ks[2]);
t_gamma ~ lognormal(prior_t_gamma[1], prior_t_gamma[2]);
for (s in 1 : 2) {
sigma_y[s] ~ lognormal(prior_sigma_y[s, 1], prior_sigma_y[s, 2]);
for (t in 1 : N_tube){
species_zero[t, s] ~ lognormal(prior_species_zero[t, s, 1],
prior_species_zero[t, s, 2]);
}
}
// likelihood
if (likelihood) {
for (m in 1 : N_measurement) {
real yhat = abundance[tube[m], measurement_timepoint[m], measured_species[m]];
y[m] ~ lognormal(log(yhat), sigma_y[measured_species[m]]);
}
}
}
generated quantities {
vector[N_measurement] yrep;
vector[N_measurement] llik;
for (m in 1 : N_measurement){
real yhat = abundance[tube[m], measurement_timepoint[m], measured_species[m]];
yrep[m] = lognormal_rng(log(yhat), sigma_y[measured_species[m]]);
llik[m] = lognormal_lpdf(y[m] | log(yhat), sigma_y[measured_species[m]]);
}
}
stan_input_true = stan_input_common | {
"y": np.ones(len(measurements)).tolist(), # dummy values as we don't need measurements yet
"likelihood": 0 # we don't need to evaluate the likelihood
}
coords = {
"strain": strains,
"tube": tubes,
"species": species,
"timepoint": timepoints.index.values,
"measurement": measurements.index.values
}
dims = {
"abundance": ["tube", "timepoint", "species"],
"mu_max": ["strain"],
"ks": ["strain"],
"gamma": ["strain"],
"species_zero": ["tube", "species"],
"y": ["measurement"],
"yrep": ["measurement"],
"llik": ["measurement"]
}
mcmc_true = model.sample(
data=stan_input_true,
iter_sampling=1,
fixed_param=True,
chains=1,
refresh=1,
inits=true_param_values,
seed=SEED,
)
idata_true = az.from_cmdstanpy(
mcmc_true,
dims=dims,
coords=coords,
posterior_predictive={"y": "yrep"},
log_likelihood="llik"
)09:25:29 - cmdstanpy - INFO - CmdStan start processing
09:25:29 - cmdstanpy - INFO - CmdStan done processing.
def plot_sim(true_abundance, fake_measurements, species_to_ax):
f, axes = plt.subplots(1, 2, figsize=[9, 3])
axes[species_to_ax[1]].set_title("Species 1")
axes[species_to_ax[2]].set_title("Species 2")
for ax in axes:
ax.set_xlabel("Time")
ax.set_ylabel("Abundance")
for (tube_i, species_i), df_i in true_abundance.groupby(["tube", "species"]):
ax = axes[species_to_ax[species_i]]
fm = df_i.merge(
fake_measurements.drop("time", axis=1),
on=["tube", "species", "timepoint"]
)
ax.plot(
df_i.set_index("time")["abundance"], color="black", linewidth=0.5
)
ax.scatter(
fm["time"],
fm["simulated_measurement"],
color="r",
marker="x",
label="simulated measurement"
)
return f, axes
species_to_ax = {1: 0, 2: 1}
true_abundance = (
idata_true.posterior["abundance"]
.to_dataframe()
.droplevel(["chain", "draw"])
.join(timepoints, on="timepoint")
.reset_index()
)
fake_measurements = measurements.join(
idata_true.posterior_predictive["yrep"]
.to_series()
.droplevel(["chain", "draw"])
.rename("simulated_measurement")
).copy()
f, axes = plot_sim(true_abundance, fake_measurements, species_to_ax)
f.savefig("img/monod_simulated_data.png")stan_input_prior = stan_input_common | {
"y": fake_measurements["simulated_measurement"],
"likelihood": 0
}
mcmc_prior = model.sample(
data=stan_input_prior,
iter_warmup=100,
iter_sampling=100,
chains=1,
refresh=1,
save_warmup=True,
inits=true_param_values,
seed=SEED,
)
idata_prior = az.from_cmdstanpy(
mcmc_prior,
dims=dims,
coords=coords,
posterior_predictive={"y": "yrep"},
log_likelihood="llik"
)
idata_prior09:25:29 - cmdstanpy - INFO - CmdStan start processing
09:25:50 - cmdstanpy - INFO - CmdStan done processing.
09:25:50 - cmdstanpy - WARNING - Non-fatal error during sampling:
Exception: ode_bdf_tol: ode parameters and data is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: ode_bdf_tol: ode parameters and data is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: ode_bdf_tol: initial state[2] is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Consider re-running with show_console=True if the above output is unclear!
<xarray.Dataset> Size: 564kB
Dimensions: (chain: 1, draw: 100, ln_mu_max_z_dim_0: 4,
ln_ks_z_dim_0: 4, ln_gamma_z_dim_0: 4, tube: 16,
species: 2, sigma_y_dim_0: 2, strain: 4, timepoint: 20)
Coordinates:
* chain (chain) int64 8B 0
* draw (draw) int64 800B 0 1 2 3 4 5 6 ... 93 94 95 96 97 98 99
* ln_mu_max_z_dim_0 (ln_mu_max_z_dim_0) int64 32B 0 1 2 3
* ln_ks_z_dim_0 (ln_ks_z_dim_0) int64 32B 0 1 2 3
* ln_gamma_z_dim_0 (ln_gamma_z_dim_0) int64 32B 0 1 2 3
* tube (tube) int64 128B 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
* species (species) int64 16B 1 2
* sigma_y_dim_0 (sigma_y_dim_0) int64 16B 0 1
* strain (strain) int64 32B 1 2 3 4
* timepoint (timepoint) int64 160B 1 2 3 4 5 6 ... 15 16 17 18 19 20
Data variables: (12/15)
ln_mu_max_z (chain, draw, ln_mu_max_z_dim_0) float64 3kB -1.257 .....
ln_ks_z (chain, draw, ln_ks_z_dim_0) float64 3kB 1.134 ... 0.0...
ln_gamma_z (chain, draw, ln_gamma_z_dim_0) float64 3kB 2.278 ... ...
a_mu_max (chain, draw) float64 800B -1.757 -1.779 ... -1.9 -1.544
a_ks (chain, draw) float64 800B -1.382 -1.365 ... -1.373
a_gamma (chain, draw) float64 800B -0.5929 -0.6364 ... -0.4605
... ...
species_zero (chain, draw, tube, species) float64 26kB 0.1343 ... 1...
sigma_y (chain, draw, sigma_y_dim_0) float64 2kB 0.103 ... 0.1167
mu_max (chain, draw, strain) float64 3kB 0.1261 0.179 ... 0.1866
ks (chain, draw, strain) float64 3kB 0.3584 ... 0.2555
gamma (chain, draw, strain) float64 3kB 0.7393 ... 0.6419
abundance (chain, draw, tube, timepoint, species) float64 512kB ...
Attributes:
created_at: 2024-04-30T07:25:50.742269
arviz_version: 0.17.0
inference_library: cmdstanpy
inference_library_version: 1.2.1array([0])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99])array([0, 1, 2, 3])
array([0, 1, 2, 3])
array([0, 1, 2, 3])
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])
array([1, 2])
array([0, 1])
array([1, 2, 3, 4])
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20])array([[[-1.25704e+00, 1.46123e-01, 2.73110e-01, 4.32168e-01],
[ 2.56057e-01, 8.82222e-01, 4.86352e-01, 4.37784e-01],
[ 1.56385e-01, 6.41261e-01, 8.94836e-01, -8.74206e-01],
[-5.26406e-01, 8.32781e-01, 1.04478e+00, -8.83506e-01],
[-1.18894e+00, 4.13661e-01, 1.65888e+00, -8.00048e-01],
[-9.56987e-01, 1.72047e-01, 1.67022e+00, -5.39850e-01],
[-1.27985e+00, 5.30518e-01, 1.66929e+00, -3.59238e-01],
[ 4.88124e-01, 1.23319e-01, -8.75954e-01, -4.75639e-01],
[ 1.37647e+00, 5.60680e-01, -1.89922e-01, -4.67899e-01],
[-9.41438e-01, 5.40375e-01, 9.70694e-01, 1.48568e+00],
[-8.28299e-01, 7.29127e-01, 1.21539e+00, 1.51449e+00],
[ 1.62069e+00, -2.33020e+00, -4.27831e-01, 2.39344e-01],
[ 9.25246e-01, 3.75749e+00, 1.00298e+00, 2.40226e-01],
[-9.55549e-01, 4.38197e-01, -8.87448e-01, -1.41593e+00],
[-3.14705e-01, 9.72369e-02, -4.71582e-01, -5.39760e-01],
[ 5.88586e-01, -2.64191e-02, 4.45607e-01, 2.95901e-01],
[-3.92727e-01, 3.70243e-01, 1.61749e-01, 6.04153e-01],
[-1.93547e-02, 3.36662e-02, 1.61821e+00, -7.94756e-01],
[ 2.04512e+00, -1.01242e+00, -8.77405e-01, 4.95403e-02],
[-2.23577e+00, 8.00444e-01, 8.35704e-01, -3.51333e-01],
...
[-3.46576e-01, -9.87028e-01, 6.99222e-02, -6.96743e-01],
[-4.14577e-01, -9.47469e-01, 3.49767e-01, -9.48599e-01],
[-3.23495e-01, -8.47136e-01, 7.44553e-02, -9.82510e-01],
[-2.25596e-01, -1.03296e+00, 1.52149e-01, -5.47013e-01],
[ 1.56284e-01, -8.12364e-01, 1.94707e-01, -5.81661e-01],
[ 6.81679e-02, -9.38737e-01, 2.02546e-01, -3.17898e-01],
[ 7.69469e-01, 1.41813e+00, 2.54130e-01, -1.13343e-01],
[ 1.65735e-01, -2.36288e+00, 7.94466e-01, -2.85698e-01],
[ 6.03559e-03, -4.06089e-01, 3.70685e-01, 1.65174e+00],
[ 6.04777e-01, -8.71298e-01, 6.13415e-01, 1.81069e+00],
[ 2.84444e-01, 1.36950e+00, -5.64750e-01, -9.38357e-01],
[ 2.61676e-01, 1.31203e+00, -3.31694e-01, -8.71329e-01],
[ 2.75732e-01, 1.43518e+00, -5.99524e-01, -3.38711e-01],
[ 5.45669e-01, 1.78253e+00, -3.90877e-02, -3.59052e-01],
[-5.39393e-01, -2.20093e+00, 4.80162e-02, 3.88923e-01],
[ 5.81911e-01, 2.11277e+00, -1.54841e-01, -4.09968e-01],
[-5.10658e-01, 7.42973e-01, 7.60975e-01, -1.75922e+00],
[-3.19379e-01, 7.05254e-01, 1.71299e-02, -9.75154e-01],
[-2.01322e-01, 1.01129e+00, 6.39685e-02, -1.37137e+00],
[-1.46123e-01, 3.43615e-01, 1.04388e+00, -5.28545e-01]]])array([[[ 1.13447e+00, -8.29042e-01, 1.11660e+00, 9.67294e-01],
[-1.28993e+00, 1.32964e+00, -1.66244e+00, -1.47922e+00],
[-8.69819e-01, -1.04942e+00, -6.38453e-01, -4.93959e-01],
[-1.47279e+00, -7.87440e-01, -4.10423e-02, -9.45293e-01],
[-1.50744e+00, -4.08436e-01, 1.38305e-02, -7.15677e-01],
[-1.19211e+00, -6.57574e-01, 3.87019e-02, -6.49278e-01],
[-1.36825e+00, -4.68140e-01, 3.83407e-01, -4.65166e-01],
[-2.04824e-01, -6.38397e-01, -3.65344e-01, -3.56069e-01],
[ 4.47184e-01, -1.82079e+00, -3.76054e-01, -1.22784e+00],
[-1.32853e-02, -5.49132e-01, 1.26031e+00, 1.07134e+00],
[ 9.98497e-02, -7.70141e-01, 1.04351e+00, 1.16496e+00],
[-3.42033e-01, -2.73159e-01, -7.74233e-01, -1.02210e+00],
[ 1.07393e+00, -7.23112e-02, 7.22464e-01, -9.71724e-01],
[ 4.79573e-01, 1.54350e+00, 8.68416e-01, -1.53499e+00],
[ 2.68485e-01, 1.30821e+00, 5.29005e-01, -1.84095e+00],
[-3.36788e-01, -1.37296e+00, -9.48244e-01, 2.07064e+00],
[-1.09735e-01, 1.21872e+00, 1.53517e+00, -2.52577e+00],
[ 1.59823e+00, 7.04790e-01, -1.79301e+00, -5.79087e-01],
[-1.82652e-01, -9.60484e-01, -2.21627e-01, 1.56755e-01],
[-1.08297e+00, 2.18051e+00, 1.75813e+00, 3.31010e-01],
...
[-1.54857e+00, 4.58905e-02, 4.61585e-01, 3.13846e-02],
[-1.30941e+00, 2.90785e-01, 6.70938e-01, 2.27883e-01],
[-1.48024e+00, 2.44321e-01, 7.64641e-01, 2.89488e-01],
[-1.62321e+00, 4.68740e-01, 6.90326e-01, 5.88403e-01],
[-1.55745e+00, 7.03937e-01, 7.84584e-01, 7.90465e-01],
[-1.61507e+00, 8.46970e-01, 5.68398e-01, 8.82636e-01],
[ 1.95775e+00, -1.29133e+00, -2.89391e-01, -7.22797e-01],
[-1.11505e+00, 1.71287e+00, -4.14685e-01, 7.78635e-01],
[ 7.39809e-01, 1.49739e+00, -7.15864e-01, -3.53607e-01],
[ 5.25094e-01, 1.59555e+00, -1.39372e+00, -8.73427e-01],
[-9.93423e-01, -9.09712e-01, 9.76356e-01, 1.60998e+00],
[-8.98714e-01, -8.94382e-01, 1.00001e+00, 1.55464e+00],
[-1.12771e+00, -1.58252e+00, 1.10339e+00, 1.82835e+00],
[-8.42594e-01, -1.41372e+00, 1.01521e+00, 1.21156e+00],
[ 8.08869e-01, 1.24786e+00, -9.89164e-01, -1.40039e+00],
[-8.01547e-01, -1.22294e+00, 9.63238e-01, 1.45322e+00],
[ 1.16044e-01, 1.86354e+00, 5.85893e-01, -9.06682e-02],
[ 4.36406e-01, 1.53318e+00, 2.58617e-01, -7.70810e-02],
[ 2.58445e-01, 1.27813e+00, 1.00048e-01, 6.49979e-05],
[-2.37000e-01, 9.17239e-01, 2.94326e-01, 2.74846e-02]]])array([[[ 2.27760e+00, -2.88877e-02, 8.76825e-01, 1.66738e+00],
[-1.64364e+00, 4.74637e-01, -5.73694e-01, -1.19532e+00],
[-1.05329e+00, -5.25101e-02, -1.67713e-01, 1.70110e-02],
[-6.55002e-02, 1.71417e-01, -8.87581e-01, -1.52869e-01],
[-1.16346e-01, 3.70469e-01, -8.94486e-01, -2.13148e-03],
[-3.88650e-01, 2.33648e-01, -1.08723e+00, 1.62565e-02],
[-2.00740e-01, 1.28711e-01, -6.52958e-01, -1.79686e-01],
[-1.01575e+00, 9.28409e-01, 6.64145e-01, -7.43491e-01],
[-5.57048e-01, 1.05764e+00, 5.93314e-01, -9.09131e-01],
[ 3.62974e-01, -2.09723e+00, -1.67337e+00, 4.73235e-01],
[ 1.37006e-01, -2.36636e+00, -1.73586e+00, 6.64678e-01],
[-5.44031e-01, 8.03165e-01, -1.08477e+00, -6.02024e-01],
[ 9.18607e-01, 5.67952e-01, 6.45011e-01, 1.61773e+00],
[ 5.65692e-02, -2.01694e-01, 2.21249e-01, 2.73169e+00],
[ 4.06184e-01, -1.39372e-01, 6.75807e-01, 1.94060e+00],
[-6.74575e-01, 4.76567e-01, -8.19501e-01, -1.74667e+00],
[ 1.25737e+00, -5.03754e-01, 6.01525e-01, 1.88017e+00],
[-7.10542e-01, -9.78554e-01, 3.39476e+00, -5.65801e-01],
[ 7.35581e-01, -1.38395e+00, -1.69451e+00, -7.19961e-01],
[ 1.00276e+00, 2.40158e-01, -3.32907e-01, -5.84841e-01],
...
[ 7.29084e-01, 1.49495e+00, -2.41163e-01, -5.02042e-01],
[ 5.42134e-01, 1.24865e+00, -1.29268e-01, -6.51325e-01],
[ 5.55109e-01, 1.07846e+00, -4.12195e-01, -9.50034e-01],
[ 6.88304e-01, 1.24574e+00, -6.01789e-01, -1.33979e+00],
[ 5.50412e-01, 1.14586e+00, -7.30567e-01, -1.10855e+00],
[ 5.24924e-01, 1.34795e+00, -8.17920e-01, -9.33201e-01],
[ 1.23902e-01, -8.14864e-01, 5.73327e-01, 4.58800e-01],
[-6.15506e-01, 9.92127e-01, -6.96236e-01, -3.23639e-01],
[-1.40420e+00, -3.47010e-01, 1.72192e+00, 9.82907e-02],
[-1.27051e+00, -1.21623e-01, 1.42244e+00, 9.49882e-02],
[-4.72647e-02, 3.99600e-02, -1.06251e+00, -1.07430e+00],
[-6.35020e-02, 1.06957e-01, -1.09373e+00, -1.17777e+00],
[ 8.86054e-02, -1.13070e-01, -1.55408e+00, -2.05000e+00],
[ 5.80039e-01, 1.38333e-01, -1.71378e+00, -1.71664e+00],
[-2.70730e-01, 1.58018e-01, 1.71495e+00, 1.90923e+00],
[ 3.09839e-01, -2.03700e-01, -1.67030e+00, -1.96502e+00],
[ 1.39508e-01, 1.23081e+00, 7.61668e-01, -7.28978e-02],
[ 7.37014e-01, 1.28111e+00, 4.66361e-01, -3.73307e-01],
[ 8.53226e-01, 1.36057e+00, 2.81113e-01, -1.23072e-01],
[ 9.08523e-01, 1.04120e+00, -1.08306e+00, 1.15864e-01]]])array([[-1.75664, -1.7787 , -1.84261, -1.84048, -1.82423, -1.85014,
-1.88075, -1.51907, -2.07709, -1.9377 , -1.6609 , -1.79077,
-1.44929, -1.46443, -1.70372, -1.60286, -1.59086, -1.57619,
-1.86153, -1.73362, -1.66933, -1.681 , -1.79995, -1.80536,
-1.80386, -1.8567 , -1.97247, -2.03835, -1.96326, -2.14831,
-1.89239, -1.89815, -1.84648, -1.66977, -1.97688, -1.96273,
-1.65747, -1.78824, -1.74885, -1.84379, -1.81665, -1.65075,
-2.14301, -2.02827, -1.70237, -1.87795, -1.52438, -1.58486,
-1.42518, -1.72836, -1.72474, -1.69481, -1.66279, -1.98461,
-1.9138 , -1.64293, -1.69642, -1.90439, -2.02058, -1.60217,
-1.72861, -1.87815, -1.83271, -2.02774, -1.99079, -2.09942,
-1.99485, -1.91802, -2.19562, -2.24523, -1.93956, -2.07604,
-1.40656, -1.4896 , -1.67486, -1.47046, -1.71897, -1.86369,
-1.76828, -1.60361, -1.47272, -2.09033, -2.01939, -1.81867,
-2.00582, -1.98071, -1.79801, -1.89882, -1.85197, -1.89697,
-2.02278, -1.99713, -1.28569, -2.06819, -1.84366, -1.78694,
-1.81975, -2.00338, -1.89973, -1.54356]])array([[-1.38212 , -1.3655 , -1.13153 , -1.17459 , -1.38064 , -1.28488 ,
-1.32014 , -1.27536 , -1.2699 , -1.35835 , -1.38595 , -1.40225 ,
-1.19755 , -1.2894 , -1.35986 , -1.45957 , -1.27646 , -1.23201 ,
-1.1629 , -1.16622 , -1.17444 , -1.16062 , -1.38351 , -1.46336 ,
-1.46196 , -1.13694 , -1.30183 , -1.3493 , -1.40456 , -1.13336 ,
-1.4043 , -1.38161 , -1.21283 , -1.42875 , -1.31663 , -1.33839 ,
-1.36959 , -1.19349 , -1.31183 , -1.33941 , -1.40941 , -1.25555 ,
-1.13697 , -1.15534 , -1.433 , -1.16668 , -1.20874 , -1.4214 ,
-1.3273 , -1.30638 , -1.34271 , -1.38923 , -1.41493 , -1.6761 ,
-1.36621 , -1.29036 , -1.29901 , -1.27018 , -1.31727 , -1.33905 ,
-1.34421 , -1.31401 , -1.17771 , -1.40293 , -1.17506 , -1.09423 ,
-1.47736 , -1.45857 , -1.14901 , -1.45347 , -1.06967 , -1.53195 ,
-1.50125 , -1.38914 , -1.20925 , -1.36351 , -1.25026 , -1.15031 ,
-1.19809 , -1.10814 , -1.49676 , -0.972995, -1.56917 , -1.15727 ,
-1.42895 , -1.29807 , -1.15632 , -1.15412 , -1.50157 , -1.51296 ,
-1.42 , -1.41419 , -1.13851 , -1.35652 , -1.1406 , -1.13623 ,
-1.18571 , -1.24463 , -1.27345 , -1.37344 ]])array([[-0.592897, -0.636445, -0.530916, -0.548767, -0.41845 , -0.510603,
-0.482938, -0.501066, -0.523522, -0.524803, -0.520775, -0.361777,
-0.661413, -0.611701, -0.502222, -0.363535, -0.518314, -0.548804,
-0.530696, -0.503341, -0.381453, -0.712704, -0.352612, -0.40736 ,
-0.445765, -0.554297, -0.62494 , -0.394142, -0.382285, -0.606243,
-0.273004, -0.476237, -0.452628, -0.431812, -0.809057, -0.736356,
-0.320153, -0.625831, -0.508725, -0.636462, -0.51195 , -0.454108,
-0.344288, -0.312116, -0.519933, -0.482481, -0.675034, -0.657394,
-0.637295, -0.677753, -0.698967, -0.385939, -0.371044, -0.445633,
-0.680363, -0.30382 , -0.692481, -0.389836, -0.561865, -0.542851,
-0.560209, -0.55142 , -0.383798, -0.440125, -0.541291, -0.466337,
-0.525984, -0.695299, -0.308861, -0.689351, -0.302832, -0.598135,
-0.561906, -0.508955, -0.491443, -0.504463, -0.5236 , -0.51573 ,
-0.457735, -0.444903, -0.536438, -0.492495, -0.551661, -0.433587,
-0.728966, -0.48227 , -0.548365, -0.533625, -0.527194, -0.478241,
-0.423171, -0.629413, -0.459531, -0.552647, -0.393814, -0.394326,
-0.440149, -0.379266, -0.579361, -0.460463]])array([[0.250027, 0.251268, 0.243294, 0.275054, 0.208164, 0.252327,
0.240801, 0.242784, 0.246601, 0.212007, 0.259461, 0.244903,
0.257267, 0.247343, 0.264167, 0.247671, 0.263706, 0.231281,
0.202615, 0.210445, 0.222926, 0.22771 , 0.253634, 0.255338,
0.252656, 0.239722, 0.229544, 0.285141, 0.297053, 0.231065,
0.245871, 0.249983, 0.226369, 0.201312, 0.301779, 0.291477,
0.23627 , 0.279103, 0.264347, 0.275687, 0.273781, 0.216982,
0.302681, 0.286689, 0.239825, 0.252847, 0.238478, 0.231182,
0.243853, 0.258878, 0.261089, 0.250533, 0.270146, 0.233927,
0.277487, 0.278498, 0.217784, 0.256461, 0.244892, 0.244619,
0.253658, 0.248164, 0.231708, 0.32951 , 0.240288, 0.253168,
0.247043, 0.227376, 0.275881, 0.220109, 0.278331, 0.222786,
0.220843, 0.25201 , 0.241599, 0.250626, 0.233342, 0.253909,
0.259399, 0.291512, 0.209401, 0.25419 , 0.24208 , 0.278665,
0.295326, 0.216797, 0.242381, 0.236982, 0.276927, 0.242949,
0.247759, 0.275206, 0.236281, 0.208451, 0.263316, 0.264472,
0.26121 , 0.269693, 0.230503, 0.256049]])array([[0.3138 , 0.327373, 0.357032, 0.332894, 0.323699, 0.283258,
0.320167, 0.288913, 0.282575, 0.326193, 0.262087, 0.324408,
0.265275, 0.253451, 0.280023, 0.297532, 0.343448, 0.247917,
0.236759, 0.239591, 0.236458, 0.300373, 0.303531, 0.322758,
0.34428 , 0.264271, 0.322225, 0.296557, 0.298837, 0.344094,
0.305228, 0.331759, 0.295843, 0.323893, 0.263759, 0.282076,
0.305759, 0.303103, 0.269853, 0.25359 , 0.270955, 0.328698,
0.279061, 0.284569, 0.342472, 0.264655, 0.284641, 0.261504,
0.269906, 0.280504, 0.283948, 0.294667, 0.309748, 0.262143,
0.233746, 0.328234, 0.273775, 0.334126, 0.277908, 0.270337,
0.266277, 0.308953, 0.319406, 0.25543 , 0.241048, 0.294196,
0.28776 , 0.309636, 0.297537, 0.306219, 0.338113, 0.27526 ,
0.261826, 0.321698, 0.281452, 0.310968, 0.282975, 0.240941,
0.264812, 0.256692, 0.357123, 0.247116, 0.37448 , 0.276792,
0.319254, 0.291425, 0.274901, 0.27499 , 0.281966, 0.259697,
0.238668, 0.262624, 0.326665, 0.30962 , 0.297234, 0.294117,
0.306963, 0.32622 , 0.297658, 0.325618]])array([[0.127728, 0.133758, 0.126569, 0.126135, 0.146703, 0.120594,
0.145815, 0.137649, 0.136116, 0.132811, 0.159526, 0.144618,
0.13104 , 0.135085, 0.132214, 0.132927, 0.147185, 0.127779,
0.113953, 0.12166 , 0.14897 , 0.144162, 0.149865, 0.141849,
0.135691, 0.134132, 0.130698, 0.131609, 0.114727, 0.150347,
0.116683, 0.130158, 0.150532, 0.128748, 0.122394, 0.112366,
0.162417, 0.113395, 0.136201, 0.135861, 0.124071, 0.149446,
0.125838, 0.134507, 0.127456, 0.143563, 0.137208, 0.132104,
0.150874, 0.128177, 0.127039, 0.134079, 0.137161, 0.141534,
0.138705, 0.127133, 0.143979, 0.119644, 0.138173, 0.137875,
0.127502, 0.13985 , 0.150958, 0.151042, 0.126087, 0.127661,
0.146502, 0.133878, 0.131028, 0.140368, 0.155489, 0.120553,
0.117853, 0.132176, 0.137966, 0.139487, 0.12697 , 0.13998 ,
0.14023 , 0.130524, 0.138536, 0.173468, 0.134119, 0.135047,
0.127299, 0.154459, 0.131183, 0.130047, 0.117995, 0.15493 ,
0.159299, 0.14678 , 0.125124, 0.114106, 0.143049, 0.143355,
0.163596, 0.133288, 0.135867, 0.148239]])array([[[[0.134292 , 1.14528 ],
[0.119757 , 1.27639 ],
[0.106511 , 1.23213 ],
...,
[0.122804 , 1.19849 ],
[0.113203 , 1.23223 ],
[0.101066 , 1.09361 ]],
[[0.13308 , 1.11781 ],
[0.12164 , 1.23478 ],
[0.110483 , 1.21598 ],
...,
[0.123072 , 1.12988 ],
[0.114354 , 1.24013 ],
[0.107319 , 1.06359 ]],
[[0.107508 , 1.24769 ],
[0.113404 , 1.22428 ],
[0.108342 , 1.33478 ],
...,
...
...,
[0.112888 , 1.24497 ],
[0.119891 , 1.16724 ],
[0.113157 , 1.25905 ]],
[[0.0936497, 1.10901 ],
[0.1149 , 1.12942 ],
[0.126336 , 1.13351 ],
...,
[0.122085 , 1.15534 ],
[0.110285 , 1.20729 ],
[0.121782 , 1.31178 ]],
[[0.137171 , 1.33195 ],
[0.139115 , 1.07304 ],
[0.11255 , 1.19714 ],
...,
[0.139124 , 1.33932 ],
[0.139762 , 1.13867 ],
[0.122946 , 1.09754 ]]]])array([[[0.103018 , 0.123026 ],
[0.0712653, 0.0867644],
[0.0840977, 0.0721943],
[0.0961897, 0.143075 ],
[0.0999729, 0.0753687],
[0.0972597, 0.0938447],
[0.100208 , 0.0943006],
[0.108581 , 0.101863 ],
[0.0800381, 0.0944252],
[0.120121 , 0.102812 ],
[0.120881 , 0.103784 ],
[0.131384 , 0.0990181],
[0.122994 , 0.0978449],
[0.0963098, 0.117497 ],
[0.104064 , 0.0852396],
[0.0901577, 0.0861396],
[0.0928114, 0.0835343],
[0.114679 , 0.109278 ],
[0.110001 , 0.113177 ],
[0.110218 , 0.117296 ],
...
[0.112118 , 0.0858086],
[0.0883329, 0.109607 ],
[0.10067 , 0.0890761],
[0.119377 , 0.0972628],
[0.113095 , 0.100517 ],
[0.0853434, 0.117981 ],
[0.0979005, 0.109729 ],
[0.101912 , 0.0987884],
[0.0996906, 0.0962712],
[0.0995598, 0.11588 ],
[0.133378 , 0.0882827],
[0.139954 , 0.0885941],
[0.0786867, 0.115797 ],
[0.129184 , 0.0858769],
[0.0780372, 0.111932 ],
[0.127517 , 0.0986251],
[0.118874 , 0.0904353],
[0.0835404, 0.110043 ],
[0.0980234, 0.11287 ],
[0.0853034, 0.11668 ]]])array([[[0.126069 , 0.179048 , 0.184824 , 0.192322 ],
[0.180078 , 0.210761 , 0.190806 , 0.188492 ],
[0.164546 , 0.185148 , 0.19693 , 0.128054 ],
[0.137343 , 0.199604 , 0.211589 , 0.124495 ],
[0.125968 , 0.175851 , 0.227886 , 0.13659 ],
[0.123487 , 0.16419 , 0.23962 , 0.137194 ],
[0.112036 , 0.173254 , 0.227916 , 0.139841 ],
[0.246459 , 0.225569 , 0.176977 , 0.195041 ],
[0.175933 , 0.143873 , 0.119561 , 0.11164 ],
[0.117974 , 0.161518 , 0.176947 , 0.19736 ],
[0.15323 , 0.229529 , 0.260394 , 0.281407 ],
[0.248116 , 0.0942841, 0.150236 , 0.176903 ],
[0.297825 , 0.617171 , 0.303841 , 0.249703 ],
[0.182541 , 0.257677 , 0.185641 , 0.162894 ],
[0.167486 , 0.186741 , 0.160687 , 0.157819 ],
[0.232915 , 0.200007 , 0.224811 , 0.216628 ],
[0.183705 , 0.224647 , 0.212629 , 0.23894 ],
[0.205838 , 0.208377 , 0.300613 , 0.172045 ],
[0.235238 , 0.126608 , 0.130119 , 0.157003 ],
[0.110347 , 0.209053 , 0.21061 , 0.164055 ],
...
[0.213249 , 0.186485 , 0.232683 , 0.198172 ],
[0.111279 , 0.0971822, 0.135143 , 0.0971543],
[0.122738 , 0.108125 , 0.13515 , 0.104639 ],
[0.152356 , 0.121661 , 0.169268 , 0.139303 ],
[0.140906 , 0.10585 , 0.142514 , 0.113313 ],
[0.140025 , 0.112564 , 0.144164 , 0.128782 ],
[0.199587 , 0.233568 , 0.176151 , 0.16114 ],
[0.155744 , 0.0855396, 0.180768 , 0.139943 ],
[0.15719 , 0.140236 , 0.173893 , 0.247942 ],
[0.173768 , 0.121402 , 0.174133 , 0.23292 ],
[0.141946 , 0.185727 , 0.115014 , 0.104845 ],
[0.145858 , 0.194746 , 0.123883 , 0.106786 ],
[0.295072 , 0.388067 , 0.239946 , 0.255198 ],
[0.141644 , 0.183303 , 0.125389 , 0.117299 ],
[0.137285 , 0.088637 , 0.16025 , 0.1753 ],
[0.195335 , 0.292827 , 0.160752 , 0.150263 ],
[0.141828 , 0.196778 , 0.197706 , 0.102358 ],
[0.123748 , 0.163135 , 0.135504 , 0.103688 ],
[0.142825 , 0.188884 , 0.151832 , 0.109062 ],
[0.205775 , 0.233266 , 0.279075 , 0.18658 ]]])array([[[0.358394 , 0.19354 , 0.35639 , 0.340078 ],
[0.167331 , 0.394472 , 0.14812 , 0.157276 ],
[0.236434 , 0.221749 , 0.256794 , 0.270389 ],
[0.189216 , 0.237706 , 0.304754 , 0.225537 ],
[0.15434 , 0.220281 , 0.252545 , 0.199427 ],
[0.197394 , 0.229662 , 0.279733 , 0.230203 ],
[0.172353 , 0.22992 , 0.301982 , 0.230139 ],
[0.26328 , 0.232282 , 0.251349 , 0.252023 ],
[0.318689 , 0.167896 , 0.252545 , 0.198521 ],
[0.255973 , 0.214924 , 0.387807 , 0.364625 ],
[0.256716 , 0.204376 , 0.328749 , 0.339381 ],
[0.220202 , 0.225177 , 0.191394 , 0.176607 ],
[0.401454 , 0.296197 , 0.365716 , 0.233325 ],
[0.311033 , 0.407301 , 0.343247 , 0.186663 ],
[0.276739 , 0.370266 , 0.297682 , 0.153298 ],
[0.210184 , 0.154422 , 0.175222 , 0.430208 ],
[0.268702 , 0.424053 , 0.472738 , 0.117193 ],
[0.433536 , 0.3474 , 0.187022 , 0.252694 ],
[0.299349 , 0.249 , 0.2966 , 0.324397 ],
[0.240343 , 0.525298 , 0.47474 , 0.337256 ],
...
[0.128762 , 0.227553 , 0.26397 , 0.226377 ],
[0.273468 , 0.406108 , 0.446107 , 0.399844 ],
[0.119614 , 0.228168 , 0.277254 , 0.23206 ],
[0.200576 , 0.357892 , 0.380529 , 0.369944 ],
[0.145705 , 0.299927 , 0.307749 , 0.308327 ],
[0.170547 , 0.349503 , 0.32225 , 0.353155 ],
[0.538952 , 0.220622 , 0.290582 , 0.257943 ],
[0.232064 , 0.505052 , 0.281351 , 0.390628 ],
[0.274454 , 0.339813 , 0.182059 , 0.201638 ],
[0.252437 , 0.333337 , 0.153369 , 0.175558 ],
[0.190691 , 0.19454 , 0.305143 , 0.354961 ],
[0.19201 , 0.192228 , 0.316143 , 0.365716 ],
[0.221597 , 0.191003 , 0.45929 , 0.582018 ],
[0.198414 , 0.166255 , 0.352683 , 0.37479 ],
[0.406497 , 0.463154 , 0.238207 , 0.2108 ],
[0.253604 , 0.224043 , 0.426166 , 0.492228 ],
[0.316609 , 0.541361 , 0.36573 , 0.297143 ],
[0.332118 , 0.474984 , 0.313404 , 0.280895 ],
[0.302243 , 0.409423 , 0.288323 , 0.279869 ],
[0.234427 , 0.341377 , 0.278705 , 0.255511 ]]])array([[[0.739349, 0.550688, 0.618225, 0.683912],
[0.424732, 0.563855, 0.490083, 0.450982],
[0.51467 , 0.58417 , 0.575714, 0.589333],
[0.572909, 0.590288, 0.516478, 0.56663 ],
[0.646929, 0.694821, 0.577138, 0.65786 ],
[0.572655, 0.617284, 0.526388, 0.601311],
[0.59917 , 0.628656, 0.560935, 0.601013],
[0.526827, 0.688478, 0.663884, 0.546945],
[0.549171, 0.684162, 0.642259, 0.523473],
[0.620893, 0.447831, 0.473764, 0.630052],
[0.607187, 0.407273, 0.450368, 0.660511],
[0.643745, 0.782215, 0.595321, 0.638368],
[0.582144, 0.555999, 0.561642, 0.637995],
[0.546588, 0.527848, 0.558884, 0.784514],
[0.638573, 0.594135, 0.661748, 0.782198],
[0.635589, 0.74068 , 0.623461, 0.551169],
[0.716592, 0.552966, 0.650653, 0.785385],
[0.527506, 0.509746, 0.891344, 0.537352],
[0.639624, 0.502379, 0.484911, 0.541865],
[0.682942, 0.622431, 0.580514, 0.562991],
...
[0.646984, 0.719403, 0.565612, 0.545535],
[0.671359, 0.758894, 0.597549, 0.545813],
[0.620512, 0.665632, 0.545014, 0.507084],
[0.71132 , 0.766935, 0.597586, 0.540899],
[0.51742 , 0.558166, 0.439566, 0.418916],
[0.669523, 0.760282, 0.544109, 0.534507],
[0.587363, 0.519306, 0.623034, 0.613743],
[0.541361, 0.667242, 0.535707, 0.562304],
[0.500132, 0.566578, 0.723239, 0.597144],
[0.509115, 0.608302, 0.772702, 0.629063],
[0.650054, 0.659149, 0.552983, 0.551946],
[0.52796 , 0.541337, 0.453867, 0.448303],
[0.638621, 0.622707, 0.51997 , 0.488685],
[0.614798, 0.584579, 0.473218, 0.473063],
[0.648858, 0.6899 , 0.862008, 0.886299],
[0.704752, 0.654733, 0.530587, 0.508636],
[0.658806, 0.787578, 0.729392, 0.636307],
[0.755005, 0.811794, 0.728254, 0.651145],
[0.629119, 0.674015, 0.582069, 0.550966],
[0.72196 , 0.736301, 0.537399, 0.641923]]])array([[[[[0.134421 , 1.14518 ],
[0.14499 , 1.13737 ],
[0.156371 , 1.12895 ],
...,
[0.472796 , 0.895002 ],
[0.507448 , 0.869383 ],
[0.544299 , 0.842137 ]],
[[0.119944 , 1.27629 ],
[0.135589 , 1.26768 ],
[0.153258 , 1.25795 ],
...,
[0.92695 , 0.831882 ],
[1.03865 , 0.77037 ],
[1.16159 , 0.702669 ]],
[[0.106664 , 1.23203 ],
[0.119427 , 1.22414 ],
[0.133694 , 1.21532 ],
...,
...
...,
[1.39665 , 0.413406 ],
[1.53516 , 0.311414 ],
[1.66293 , 0.217339 ]],
[[0.140076 , 1.1385 ],
[0.167142 , 1.12396 ],
[0.19934 , 1.10665 ],
...,
[1.99388 , 0.142269 ],
[2.11829 , 0.075412 ],
[2.19374 , 0.0348663]],
[[0.123132 , 1.09742 ],
[0.138735 , 1.0874 ],
[0.156279 , 1.07614 ],
...,
[0.86867 , 0.618842 ],
[0.962576 , 0.558562 ],
[1.06284 , 0.494198 ]]]]])PandasIndex(Index([0], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99],
dtype='int64', name='draw'))PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='ln_mu_max_z_dim_0'))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='ln_ks_z_dim_0'))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='ln_gamma_z_dim_0'))
PandasIndex(Index([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], dtype='int64', name='tube'))
PandasIndex(Index([1, 2], dtype='int64', name='species'))
PandasIndex(Index([0, 1], dtype='int64', name='sigma_y_dim_0'))
PandasIndex(Index([1, 2, 3, 4], dtype='int64', name='strain'))
PandasIndex(Index([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], dtype='int64', name='timepoint'))
<xarray.Dataset> Size: 130kB
Dimensions: (chain: 1, draw: 100, measurement: 160)
Coordinates:
* chain (chain) int64 8B 0
* draw (draw) int64 800B 0 1 2 3 4 5 6 7 8 ... 92 93 94 95 96 97 98 99
* measurement (measurement) int64 1kB 1 2 3 4 5 6 ... 155 156 157 158 159 160
Data variables:
yrep (chain, draw, measurement) float64 128kB 0.1959 1.416 ... 0.666
Attributes:
created_at: 2024-04-30T07:25:50.748438
arviz_version: 0.17.0
inference_library: cmdstanpy
inference_library_version: 1.2.1array([0])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99])array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
155, 156, 157, 158, 159, 160])array([[[0.195866, 1.41642 , 0.188514, ..., 0.747434, 0.586974,
1.00298 ],
[0.160048, 1.0563 , 0.286886, ..., 0.859076, 0.85545 ,
0.776678],
[0.135647, 1.31836 , 0.192262, ..., 0.829057, 0.435652,
0.884375],
...,
[0.166325, 1.21941 , 0.226758, ..., 1.14687 , 0.302638,
0.968309],
[0.14274 , 1.18061 , 0.155557, ..., 1.13299 , 0.418849,
1.20289 ],
[0.215505, 1.41985 , 0.317938, ..., 0.745954, 0.805973,
0.666039]]])PandasIndex(Index([0], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99],
dtype='int64', name='draw'))PandasIndex(Index([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
...
151, 152, 153, 154, 155, 156, 157, 158, 159, 160],
dtype='int64', name='measurement', length=160))<xarray.Dataset> Size: 130kB
Dimensions: (chain: 1, draw: 100, measurement: 160)
Coordinates:
* chain (chain) int64 8B 0
* draw (draw) int64 800B 0 1 2 3 4 5 6 7 8 ... 92 93 94 95 96 97 98 99
* measurement (measurement) int64 1kB 1 2 3 4 5 6 ... 155 156 157 158 159 160
Data variables:
llik (chain, draw, measurement) float64 128kB -1.07 0.1169 ... -1.94
Attributes:
created_at: 2024-04-30T07:25:50.749531
arviz_version: 0.17.0
inference_library: cmdstanpy
inference_library_version: 1.2.1array([0])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99])array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
155, 156, 157, 158, 159, 160])array([[[-1.06968e+00, 1.16949e-01, -1.41851e+01, ..., 9.51414e-01,
-3.02032e-01, 2.51154e-03],
[ 9.03113e-01, -8.86681e-01, -6.97452e+00, ..., 8.62151e-01,
9.51545e-01, -1.21425e+00],
[-8.83552e+00, 1.04717e+00, -2.40412e+01, ..., -3.97020e+00,
-1.88287e+01, 1.78695e+00],
...,
[-1.43600e+00, 9.59053e-01, -1.87099e+01, ..., -6.93967e+00,
-4.66261e+01, -4.11203e-01],
[-1.64705e+01, -2.89701e-01, -3.74528e+01, ..., -8.23424e+00,
-2.26718e+01, -1.17466e+00],
[ 2.59532e+00, 9.46167e-01, -2.12880e-01, ..., 1.41127e+00,
1.67558e+00, -1.93967e+00]]])PandasIndex(Index([0], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99],
dtype='int64', name='draw'))PandasIndex(Index([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
...
151, 152, 153, 154, 155, 156, 157, 158, 159, 160],
dtype='int64', name='measurement', length=160))<xarray.Dataset> Size: 11kB
Dimensions: (chain: 1, draw: 200)
Coordinates:
* chain (chain) int64 8B 0
* draw (draw) int64 2kB 0 1 2 3 4 5 6 ... 194 195 196 197 198 199
Data variables:
lp (chain, draw) float64 2kB -58.6 -58.6 ... -56.34 -51.74
acceptance_rate (chain, draw) float64 2kB 0.9268 0.0 0.0 ... 0.6867 0.9951
step_size (chain, draw) float64 2kB 0.03125 12.59 ... 0.05727 0.05727
tree_depth (chain, draw) int64 2kB 7 0 0 4 6 7 7 4 ... 4 4 6 6 6 4 5 5
n_steps (chain, draw) int64 2kB 127 1 1 15 95 ... 63 63 31 39 47
diverging (chain, draw) bool 200B False True True ... False False
energy (chain, draw) float64 2kB 78.86 82.76 80.81 ... 80.22 71.82
Attributes:
created_at: 2024-04-30T07:25:50.746660
arviz_version: 0.17.0
inference_library: cmdstanpy
inference_library_version: 1.2.1array([0])
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195,
196, 197, 198, 199])array([[-58.6048, -58.6048, -58.6048, -58.6048, -57.0495, -60.0722,
-55.2909, -60.2785, -63.1716, -61.9213, -69.2293, -62.5434,
-60.4092, -58.1287, -54.828 , -53.7938, -52.5055, -58.7889,
-56.6883, -58.6782, -57.0165, -58.8267, -58.6879, -58.0898,
-51.8262, -63.2264, -55.4352, -54.0964, -65.8154, -59.5635,
-59.607 , -67.2881, -58.1025, -57.4409, -59.2845, -56.3952,
-61.8801, -67.7182, -65.7617, -60.9002, -61.8904, -63.4106,
-67.6167, -55.6828, -57.7476, -59.8308, -62.0655, -68.1531,
-71.9688, -65.5754, -57.5692, -66.398 , -56.8265, -54.7328,
-60.9109, -60.4608, -65.3202, -52.868 , -57.2536, -55.3238,
-53.1337, -53.5083, -57.6754, -65.0288, -57.7689, -59.108 ,
-65.6542, -56.7001, -54.316 , -54.5284, -61.4435, -62.0594,
-65.4503, -63.9036, -57.9646, -61.1691, -58.67 , -59.9672,
-62.2866, -67.5737, -51.7767, -53.291 , -48.9425, -51.3255,
-57.009 , -50.455 , -51.0243, -52.9944, -66.1919, -51.9835,
-51.6539, -60.3069, -51.2788, -52.8907, -58.3601, -59.8951,
-55.1466, -54.9873, -54.6765, -59.5826, -57.1969, -59.3743,
-56.6196, -58.8966, -62.1715, -61.0625, -56.7016, -54.1262,
-56.868 , -64.3248, -69.0715, -54.176 , -61.686 , -59.8144,
-59.4087, -58.3806, -60.8654, -65.4199, -64.8562, -65.2462,
-70.6903, -62.4129, -55.9886, -61.3174, -61.5457, -61.2949,
-56.0023, -59.7949, -61.993 , -69.2833, -70.6813, -60.5745,
-69.1824, -57.692 , -70.8145, -57.9204, -58.3472, -58.6702,
-55.9889, -56.6111, -52.3047, -50.2385, -56.6622, -60.6632,
-54.4951, -54.0938, -65.008 , -58.8823, -54.3016, -52.894 ,
-52.8059, -52.4381, -58.1012, -67.1034, -56.6691, -56.0413,
-60.7917, -61.3587, -58.0845, -56.7403, -59.7203, -61.7424,
-68.7743, -77.8869, -59.36 , -66.8403, -63.7877, -68.7899,
-68.8369, -70.6389, -71.6705, -67.2872, -57.1933, -57.6935,
-61.9538, -58.3722, -57.9886, -60.1303, -61.9579, -60.267 ,
-64.199 , -69.2978, -73.0657, -68.176 , -73.3675, -65.5747,
-58.9866, -61.9784, -57.6639, -59.3372, -62.3391, -65.8443,
-75.5784, -60.819 , -60.0743, -59.7531, -58.6591, -52.5399,
-56.3384, -51.7446]])array([[9.26757e-01, 0.00000e+00, 0.00000e+00, 4.15275e-07, 9.76496e-01,
9.67671e-01, 8.80693e-01, 9.05453e-01, 8.71827e-01, 9.17820e-01,
7.73219e-01, 9.17951e-01, 6.04554e-01, 9.96156e-01, 6.30245e-01,
4.94417e-01, 9.67753e-01, 7.90591e-01, 9.91040e-01, 8.30714e-01,
6.48149e-01, 6.87872e-01, 9.86418e-01, 9.84442e-01, 7.06031e-02,
9.85406e-01, 9.98580e-01, 5.34236e-01, 8.50447e-01, 9.98506e-01,
7.86500e-01, 6.82376e-01, 1.00000e+00, 8.27157e-01, 9.54891e-01,
8.17556e-02, 9.53133e-01, 9.91099e-01, 8.61260e-01, 7.69243e-01,
9.03339e-01, 5.82686e-01, 8.00382e-01, 9.39302e-01, 2.91911e-01,
9.81353e-01, 1.00000e+00, 9.15554e-01, 3.33310e-01, 9.70604e-01,
9.96376e-01, 5.04699e-01, 9.94489e-01, 5.12153e-01, 8.72913e-01,
9.32881e-01, 3.91760e-01, 1.00000e+00, 9.32069e-01, 7.72947e-01,
9.76212e-01, 3.17392e-01, 9.60516e-01, 8.48580e-01, 1.00000e+00,
4.68695e-01, 8.75956e-01, 8.84637e-01, 7.47462e-01, 7.74819e-01,
7.83783e-01, 7.66883e-01, 8.17644e-01, 8.25479e-01, 9.88187e-01,
4.04629e-01, 9.28758e-01, 5.93088e-01, 9.38169e-01, 8.20680e-01,
1.00000e+00, 2.73707e-01, 9.99757e-01, 5.35283e-01, 9.15210e-01,
9.99319e-01, 6.94933e-01, 9.00822e-01, 5.05535e-01, 9.98875e-01,
7.74495e-01, 8.19984e-01, 9.97671e-01, 4.89215e-01, 9.01405e-01,
8.58887e-01, 7.61627e-01, 5.16337e-01, 8.68469e-01, 8.48006e-01,
6.53246e-01, 8.75766e-01, 9.31120e-01, 7.70085e-01, 8.67168e-01,
9.75150e-01, 8.24386e-01, 9.92946e-01, 7.27563e-01, 8.07874e-01,
8.81715e-01, 9.97891e-01, 7.03539e-01, 6.93359e-01, 8.39117e-01,
9.97535e-01, 8.40310e-01, 9.70479e-01, 8.76601e-01, 9.63590e-01,
7.80645e-01, 9.96861e-01, 9.27210e-01, 9.10064e-01, 9.50023e-01,
9.77658e-01, 7.47987e-01, 5.67010e-01, 9.03358e-01, 9.18203e-01,
8.14216e-01, 9.64671e-01, 7.83933e-01, 9.79917e-01, 5.48645e-01,
9.99840e-01, 8.61332e-01, 8.07722e-01, 9.42404e-01, 8.37435e-01,
9.96729e-01, 8.05703e-01, 8.04326e-01, 9.76829e-01, 8.33988e-01,
8.83372e-01, 7.41326e-01, 9.91197e-01, 9.81908e-01, 9.56325e-01,
8.83673e-01, 8.81153e-01, 8.32485e-01, 7.30035e-01, 1.00000e+00,
9.97318e-01, 9.93111e-01, 9.97750e-01, 8.67459e-01, 7.44329e-01,
6.86905e-01, 7.61603e-01, 8.49242e-01, 6.90757e-01, 1.00000e+00,
6.69544e-01, 9.84007e-01, 7.02282e-01, 9.78342e-01, 7.31150e-01,
8.94235e-01, 9.85702e-01, 9.99967e-01, 9.38881e-01, 8.61789e-01,
9.71803e-01, 7.87307e-01, 7.11989e-01, 9.70108e-01, 9.29145e-01,
7.27099e-01, 8.08279e-01, 8.74393e-01, 9.99637e-01, 7.81144e-01,
1.00000e+00, 9.43050e-01, 8.46536e-01, 9.48579e-01, 9.17649e-01,
9.12324e-01, 8.60802e-01, 8.98609e-01, 1.00000e+00, 7.82472e-01,
9.75986e-01, 9.43740e-01, 9.97829e-01, 6.86744e-01, 9.95121e-01]])array([[ 0.03125 , 12.5919 , 2.04569 , 0.197275 , 0.0151101,
0.0192796, 0.0272152, 0.0317209, 0.0417976, 0.0510688,
0.0735843, 0.0679933, 0.100071 , 0.0553381, 0.104964 ,
0.0638403, 0.0258198, 0.0450416, 0.0456492, 0.0846505,
0.0964796, 0.0640191, 0.0480947, 0.0865242, 0.153314 ,
0.0197702, 0.0352499, 0.0645981, 0.032157 , 0.0387887,
0.0699669, 0.0702711, 0.0533096, 0.0949123, 0.105883 ,
0.164967 , 0.0261627, 0.0407291, 0.0694148, 0.0842709,
0.0808117, 0.108571 , 0.0652963, 0.0677885, 0.0989324,
0.0295992, 0.0478377, 0.0803101, 0.109395 , 0.0372666,
0.0578346, 0.0947681, 0.049153 , 0.0797376, 0.0424601,
0.0519046, 0.072498 , 0.0297821, 0.0482974, 0.0669265,
0.0649488, 0.0985937, 0.0352479, 0.0516292, 0.0590995,
0.0935246, 0.0472792, 0.0572374, 0.0704191, 0.0647714,
0.0631338, 0.0627051, 0.0601354, 0.0640441, 0.0692567,
0.10424 , 0.0478571, 0.0637348, 0.0431427, 0.0583971,
0.0623914, 0.0949678, 0.034459 , 0.0523532, 0.0320236,
0.0411334, 0.0620068, 0.0518535, 0.0644112, 0.0375903,
0.0562021, 0.0547981, 0.0582087, 0.0861876, 0.0492809,
0.0608541, 0.0693346, 0.0659688, 0.0400478, 0.0464272,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658,
0.0572658, 0.0572658, 0.0572658, 0.0572658, 0.0572658]])array([[7, 0, 0, 4, 6, 7, 7, 4, 7, 5, 5, 6, 6, 3, 4, 3, 4, 3, 6, 6, 5, 3,
6, 5, 5, 7, 7, 4, 5, 7, 6, 6, 3, 5, 5, 5, 5, 6, 6, 6, 6, 5, 6, 6,
3, 4, 5, 6, 5, 6, 5, 4, 3, 4, 7, 5, 5, 4, 6, 6, 5, 4, 7, 3, 3, 5,
4, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 5, 7, 6, 4, 3, 6, 3, 4, 7, 4, 6,
5, 5, 5, 6, 5, 5, 6, 6, 6, 6, 7, 6, 3, 6, 6, 4, 4, 3, 3, 5, 4, 6,
3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 3, 6, 6, 4, 6, 6, 6, 3, 6,
6, 6, 3, 6, 6, 5, 4, 4, 4, 3, 4, 6, 3, 5, 5, 4, 3, 6, 6, 6, 5, 4,
3, 4, 6, 6, 6, 6, 6, 6, 6, 3, 3, 6, 6, 3, 3, 6, 3, 6, 6, 5, 6, 5,
3, 4, 4, 3, 3, 3, 3, 4, 4, 3, 6, 6, 6, 4, 6, 4, 4, 4, 6, 6, 6, 4,
5, 5]])array([[127, 1, 1, 15, 95, 127, 127, 15, 127, 39, 31, 63, 127,
7, 31, 15, 15, 15, 63, 63, 31, 15, 63, 31, 31, 255,
127, 23, 47, 127, 63, 63, 7, 31, 31, 31, 63, 63, 63,
63, 63, 31, 63, 63, 15, 15, 47, 63, 31, 63, 55, 31,
15, 23, 127, 47, 63, 15, 63, 63, 47, 31, 127, 15, 7,
31, 15, 63, 63, 63, 63, 63, 63, 63, 63, 31, 63, 39,
127, 63, 23, 7, 95, 7, 31, 127, 31, 63, 39, 63, 47,
63, 63, 47, 63, 63, 63, 63, 127, 127, 15, 63, 63, 31,
23, 15, 15, 39, 23, 63, 7, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 55, 7, 63, 63, 23, 63, 63, 63,
7, 63, 63, 63, 7, 63, 63, 55, 31, 31, 31, 15, 31,
63, 15, 39, 39, 31, 15, 63, 63, 63, 47, 23, 7, 31,
63, 63, 63, 63, 63, 63, 63, 7, 7, 63, 63, 15, 7,
63, 7, 63, 63, 47, 63, 55, 15, 23, 23, 15, 7, 7,
7, 23, 23, 7, 63, 63, 63, 15, 63, 23, 23, 15, 63,
63, 63, 31, 39, 47]])array([[False, True, True, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False, False, False, False, False, False, False, False,
False, False]])array([[ 78.8602, 82.7591, 80.8114, 80.7794, 82.7418, 91.0099,
92.9877, 80.0374, 86.5825, 91.9513, 93.7189, 92.7244,
86.8454, 79.5793, 80.4784, 83.376 , 73.1065, 74.3291,
80.9646, 79.6666, 80.1301, 82.3769, 77.5666, 75.6883,
87.3459, 82.7512, 81.888 , 83.0343, 85.6575, 92.1114,
84.802 , 87.1944, 82.4074, 77.7009, 78.5077, 87.468 ,
89.3935, 98.349 , 95.5323, 92.6367, 89.1492, 88.5632,
91.0312, 88.5949, 94.8072, 81.2396, 82.8426, 89.4432,
110.435 , 103.165 , 88.1175, 89.0558, 86.6067, 84.5048,
78.1522, 89.1505, 103.437 , 78.7436, 76.7479, 80.5473,
72.673 , 81.7957, 77.9485, 84.769 , 83.4912, 87.7797,
83.8309, 94.1106, 81.6622, 78.2644, 81.5752, 89.0636,
93.3087, 97.4376, 86.3968, 87.4867, 85.599 , 94.9595,
91.2701, 90.7952, 83.1709, 79.3676, 67.6398, 86.6999,
75.5488, 72.6459, 76.9973, 76.5047, 86.1134, 84.0877,
83.8123, 77.1836, 76.8308, 77.045 , 76.4716, 82.9793,
82.967 , 84.9756, 79.2393, 82.7648, 88.1495, 83.5465,
79.858 , 86.5232, 84.4287, 82.4817, 85.1366, 74.8682,
84.5242, 84.8963, 92.5777, 86.8654, 88.0376, 93.2229,
85.4782, 83.2684, 85.7699, 88.3162, 91.5251, 93.5257,
102.933 , 95.3181, 86.069 , 77.9593, 87.4147, 87.0359,
88.2101, 90.0936, 82.5068, 85.4613, 95.8255, 94.065 ,
91.0461, 94.1312, 90.5257, 87.385 , 85.7329, 85.2045,
85.4298, 83.0275, 74.004 , 74.9827, 76.6576, 80.1785,
88.6778, 75.6836, 84.5215, 82.8775, 76.9601, 76.5793,
72.4169, 70.8732, 72.974 , 91.6481, 87.4817, 77.3688,
82.2084, 80.5267, 86.4446, 86.034 , 93.1437, 88.4245,
95.3553, 106.628 , 96.2024, 95.129 , 87.1269, 93.9725,
91.2743, 109.742 , 97.3843, 94.5153, 82.8333, 89.2644,
86.2935, 82.8175, 87.0762, 90.5778, 88.8285, 81.3797,
86.2099, 92.1065, 99.421 , 102.038 , 107.95 , 93.8631,
89.7448, 88.4546, 86.5707, 81.8977, 86.4589, 88.9054,
97.7194, 94.3079, 90.2654, 82.3723, 80.3507, 77.1395,
80.2215, 71.82 ]])PandasIndex(Index([0], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
...
190, 191, 192, 193, 194, 195, 196, 197, 198, 199],
dtype='int64', name='draw', length=200))We can find the prior intervals for the true abundance and plot them in the graph.
prior_abundances = idata_prior.posterior["abundance"]
n_sample = 20
chains = rng.choice(prior_abundances.coords["chain"].values, n_sample)
draws = rng.choice(prior_abundances.coords["draw"].values, n_sample)
f, axes = plot_sim(true_abundance, fake_measurements, species_to_ax)
for ax, species_i in zip(axes, species):
for tube_j in tubes:
for chain, draw in zip(chains, draws):
timeseries = prior_abundances.sel(chain=chain, draw=draw, tube=tube_j, species=species_i)
ax.plot(
timepoints.values,
timeseries.values,
alpha=0.5, color="skyblue", zorder=-1
)
f.savefig("img/monod_priors.png")stan_input_posterior = stan_input_common | {
"y": fake_measurements["simulated_measurement"],
"likelihood": 1
}
mcmc_posterior = model.sample(
data=stan_input_posterior,
iter_warmup=300,
iter_sampling=300,
chains=4,
refresh=1,
inits=true_param_values,
seed=SEED,
)
idata_posterior = az.from_cmdstanpy(
mcmc_posterior,
dims=dims,
coords=coords,
posterior_predictive={"y": "yrep"},
log_likelihood="llik"
)
idata_posterior09:25:51 - cmdstanpy - INFO - CmdStan start processing
09:32:24 - cmdstanpy - INFO - CmdStan done processing.
09:32:24 - cmdstanpy - WARNING - Non-fatal error during sampling:
Exception: ode_bdf_tol: ode parameters and data is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: lognormal_lpdf: Location parameter is -nan, but must be finite! (in 'monod.stan', line 85, column 6 to column 64)
Exception: ode_bdf_tol: initial state[1] is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: ode_bdf_tol: ode parameters and data is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: lognormal_lpdf: Location parameter is -nan, but must be finite! (in 'monod.stan', line 85, column 6 to column 64)
Exception: lognormal_lpdf: Location parameter is -nan, but must be finite! (in 'monod.stan', line 85, column 6 to column 64)
Exception: lognormal_lpdf: Location parameter is -nan, but must be finite! (in 'monod.stan', line 85, column 6 to column 64)
Exception: lognormal_lpdf: Location parameter is -nan, but must be finite! (in 'monod.stan', line 85, column 6 to column 64)
Exception: ode_bdf_tol: initial state[1] is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: ode_bdf_tol: ode parameters and data is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: lognormal_lpdf: Location parameter is -nan, but must be finite! (in 'monod.stan', line 85, column 6 to column 64)
Exception: ode_bdf_tol: ode parameters and data is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: ode_bdf_tol: ode parameters and data is inf, but must be finite! (in 'monod.stan', line 56, column 4 to line 60, column 79)
Exception: lognormal_lpdf: Location parameter is -nan, but must be finite! (in 'monod.stan', line 85, column 6 to column 64)
Exception: lognormal_lpdf: Location parameter is -nan, but must be finite! (in 'monod.stan', line 85, column 6 to column 64)
Consider re-running with show_console=True if the above output is unclear!
<xarray.Dataset> Size: 7MB
Dimensions: (chain: 4, draw: 300, ln_mu_max_z_dim_0: 4,
ln_ks_z_dim_0: 4, ln_gamma_z_dim_0: 4, tube: 16,
species: 2, sigma_y_dim_0: 2, strain: 4, timepoint: 20)
Coordinates:
* chain (chain) int64 32B 0 1 2 3
* draw (draw) int64 2kB 0 1 2 3 4 5 ... 294 295 296 297 298 299
* ln_mu_max_z_dim_0 (ln_mu_max_z_dim_0) int64 32B 0 1 2 3
* ln_ks_z_dim_0 (ln_ks_z_dim_0) int64 32B 0 1 2 3
* ln_gamma_z_dim_0 (ln_gamma_z_dim_0) int64 32B 0 1 2 3
* tube (tube) int64 128B 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
* species (species) int64 16B 1 2
* sigma_y_dim_0 (sigma_y_dim_0) int64 16B 0 1
* strain (strain) int64 32B 1 2 3 4
* timepoint (timepoint) int64 160B 1 2 3 4 5 6 ... 15 16 17 18 19 20
Data variables: (12/15)
ln_mu_max_z (chain, draw, ln_mu_max_z_dim_0) float64 38kB 1.44 ......
ln_ks_z (chain, draw, ln_ks_z_dim_0) float64 38kB 0.2322 ... 0...
ln_gamma_z (chain, draw, ln_gamma_z_dim_0) float64 38kB -0.4819 ....
a_mu_max (chain, draw) float64 10kB -1.552 -1.759 ... -1.551 -1.77
a_ks (chain, draw) float64 10kB -1.211 -1.338 ... -1.422
a_gamma (chain, draw) float64 10kB -0.5341 -0.5231 ... -0.4704
... ...
species_zero (chain, draw, tube, species) float64 307kB 0.127 ... 1...
sigma_y (chain, draw, sigma_y_dim_0) float64 19kB 0.08225 ... ...
mu_max (chain, draw, strain) float64 38kB 0.3066 ... 0.1696
ks (chain, draw, strain) float64 38kB 0.319 ... 0.2912
gamma (chain, draw, strain) float64 38kB 0.5479 ... 0.6565
abundance (chain, draw, tube, timepoint, species) float64 6MB 0....
Attributes:
created_at: 2024-04-30T07:32:24.228168
arviz_version: 0.17.0
inference_library: cmdstanpy
inference_library_version: 1.2.1array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 297, 298, 299])
array([0, 1, 2, 3])
array([0, 1, 2, 3])
array([0, 1, 2, 3])
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16])
array([1, 2])
array([0, 1])
array([1, 2, 3, 4])
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20])array([[[ 1.43964 , -2.07539 , -0.480108 , -0.476268 ],
[ 2.14933 , -0.639818 , -0.136004 , 0.43 ],
[ 1.83206 , -1.22235 , -0.115291 , 0.868755 ],
...,
[ 2.5687 , -1.44086 , 0.621402 , -0.328346 ],
[ 2.79695 , -1.60759 , 0.830904 , 0.0429799],
[ 2.66339 , -1.69941 , 0.80337 , -0.199915 ]],
[[ 1.77155 , -1.70135 , -0.128963 , -0.307049 ],
[ 1.33849 , -1.35961 , -0.937327 , -0.882081 ],
[ 1.46541 , -1.0822 , -0.959903 , -1.0799 ],
...,
[ 2.5895 , -0.763728 , 0.588707 , 0.720792 ],
[ 1.78995 , -1.48543 , -0.589971 , -0.429114 ],
[ 2.68589 , -1.03037 , -0.144811 , -0.0397646]],
[[ 2.80766 , -0.499835 , 0.856673 , 1.15522 ],
[ 2.283 , -0.626296 , 0.700771 , 0.782596 ],
[ 2.36057 , -0.282299 , 0.656092 , 0.599962 ],
...,
[ 1.87784 , -1.08237 , 0.11332 , 0.147031 ],
[ 1.8798 , -1.9366 , -0.252805 , -0.561231 ],
[ 1.86706 , -2.01245 , -0.342733 , -0.402687 ]],
[[ 1.72097 , -0.798292 , -0.0619448, 0.385759 ],
[ 1.55378 , -1.42811 , -0.0344052, -0.243571 ],
[ 2.49534 , -0.639839 , 0.0364284, 0.798284 ],
...,
[ 2.48553 , -0.874164 , 0.488614 , 0.345169 ],
[ 0.935276 , -1.80867 , -0.886871 , -0.649151 ],
[ 2.23011 , -1.25447 , 0.122228 , -0.0196958]]])array([[[ 0.232193 , -0.993438 , 1.21535 , 0.0555106 ],
[-0.112696 , 1.30585 , -1.23193 , 0.760839 ],
[-0.35623 , -0.21666 , -0.528023 , 2.01192 ],
...,
[ 0.637344 , -0.447281 , 2.01426 , -0.905051 ],
[ 0.479432 , -1.37802 , 2.12197 , -0.745629 ],
[ 0.104107 , -0.936886 , 2.50349 , -0.562207 ]],
[[-0.507451 , 1.09847 , 1.39201 , 0.172546 ],
[-0.622539 , 1.77895 , -1.30323 , -1.45846 ],
[-0.0206634 , 2.71434 , -0.387853 , -1.38587 ],
...,
[ 0.510413 , -1.41813 , 0.464166 , 0.777791 ],
[-0.778757 , 0.500842 , -0.439454 , 0.136273 ],
[ 1.21993 , 0.505053 , -0.262018 , -0.910803 ]],
[[-0.20656 , -0.711122 , 0.471984 , 0.558205 ],
[-1.11553 , -0.462498 , 0.244496 , 0.204236 ],
[-0.917741 , 0.909479 , 0.223158 , -0.38252 ],
...,
[ 0.266817 , 1.22857 , 0.89577 , 1.37627 ],
[-0.0507751 , -0.806308 , 0.182342 , -2.42045 ],
[ 0.197544 , -2.66593 , -0.760431 , -1.15723 ]],
[[-0.986154 , 1.17482 , -1.13507 , 0.784005 ],
[-1.33177 , -0.967554 , 0.342234 , -0.0393334 ],
[-0.194734 , 1.57597 , -0.427179 , 0.867152 ],
...,
[-0.0764064 , 1.03301 , 1.47118 , 0.798913 ],
[-1.60072 , -0.22092 , -1.0382 , -0.64229 ],
[-0.0859219 , 0.00345018, 0.802034 , 0.624204 ]]])array([[[-0.481869 , -1.08469 , 1.05593 , 0.700992 ],
[-0.376054 , -0.257684 , -0.833916 , -0.437308 ],
[ 0.430811 , -0.443226 , -1.13387 , -0.665901 ],
...,
[-0.431813 , 2.97331 , 0.56932 , 0.158556 ],
[-0.899488 , 2.6287 , 1.05759 , 0.186152 ],
[-0.488969 , 1.96513 , 0.581532 , 0.548718 ]],
[[ 0.556725 , 0.657734 , 0.791071 , -0.0964423 ],
[ 0.306999 , 0.830107 , 2.0521 , 0.316339 ],
[-0.239339 , -0.152881 , 1.44206 , 1.03567 ],
...,
[-0.858468 , 0.502376 , 0.165161 , -0.464223 ],
[ 0.544835 , -0.4659 , -0.153035 , 2.89561 ],
[-0.481186 , -2.0996 , 0.630994 , 1.10187 ]],
[[-0.660161 , 0.133659 , -1.06296 , -0.212492 ],
[-0.77063 , 0.128364 , -0.75639 , -0.138919 ],
[-0.18801 , 0.457842 , -1.1757 , -0.458183 ],
...,
[-0.0124985 , 0.843747 , -0.119322 , 1.3118 ],
[ 0.337861 , 0.422073 , 1.03061 , 1.56057 ],
[-0.360246 , 0.502159 , 1.04323 , 1.39688 ]],
[[-0.403849 , -0.00556633, 1.00196 , -0.203046 ],
[ 0.0559757 , 1.81596 , 0.873108 , 2.51037 ],
[-0.279078 , -1.6516 , -2.87617 , -0.720547 ],
...,
[-0.98695 , -0.89747 , -1.88445 , -1.45724 ],
[-0.680618 , 1.83281 , 0.246619 , 1.73185 ],
[-0.94155 , -0.364602 , -1.38733 , 0.362687 ]]])array([[-1.55191, -1.7591 , -1.78322, ..., -1.72957, -1.78749, -1.73027],
[-1.61848, -1.59448, -1.57081, ..., -1.9078 , -1.63069, -1.74218],
[-1.97032, -1.90282, -1.92015, ..., -1.69575, -1.68055, -1.70269],
[-1.76489, -1.73379, -1.78184, ..., -1.83709, -1.55069, -1.76969]])array([[-1.21088, -1.33753, -1.35064, ..., -1.22029, -1.2802 , -1.16265],
[-1.19039, -1.36207, -1.32648, ..., -1.31252, -1.21392, -1.17491],
[-1.34337, -1.25926, -1.27406, ..., -1.36062, -1.30982, -1.4372 ],
[-1.13844, -1.36224, -1.13885, ..., -1.50129, -1.16884, -1.42218]])array([[-0.534115, -0.523109, -0.576391, ..., -0.56432 , -0.524737,
-0.541015],
[-0.704445, -0.694588, -0.593268, ..., -0.460145, -0.604671,
-0.439915],
[-0.48952 , -0.487978, -0.54914 , ..., -0.631705, -0.709394,
-0.626348],
[-0.497183, -0.679197, -0.448852, ..., -0.450101, -0.558203,
-0.47039 ]])array([[0.256876, 0.237519, 0.272467, ..., 0.231494, 0.229587, 0.217673],
[0.228813, 0.25043 , 0.226689, ..., 0.277648, 0.215129, 0.246671],
[0.255465, 0.270097, 0.270125, ..., 0.270354, 0.251784, 0.266796],
[0.296958, 0.271821, 0.234714, ..., 0.220754, 0.283978, 0.232559]])array([[0.293897, 0.303692, 0.329511, ..., 0.264736, 0.272606, 0.279762],
[0.289435, 0.328538, 0.335106, ..., 0.288878, 0.302213, 0.285777],
[0.32671 , 0.305674, 0.309111, ..., 0.33276 , 0.23913 , 0.273322],
[0.311004, 0.303607, 0.267113, ..., 0.308393, 0.300841, 0.302048]])array([[0.140044, 0.135942, 0.132985, ..., 0.144458, 0.146196, 0.139162],
[0.143113, 0.110623, 0.10828 , ..., 0.151485, 0.132237, 0.115262],
[0.138039, 0.144082, 0.14821 , ..., 0.141077, 0.167302, 0.144753],
[0.131864, 0.136226, 0.116536, ..., 0.132434, 0.127331, 0.136693]])array([[[[0.127043, 1.22033 ],
[0.126188, 1.22567 ],
[0.136362, 1.25293 ],
...,
[0.114655, 1.17641 ],
[0.129273, 1.12277 ],
[0.117 , 1.20786 ]],
[[0.132279, 1.27465 ],
[0.117335, 1.21091 ],
[0.127426, 1.14463 ],
...,
[0.114699, 1.14744 ],
[0.133546, 1.10304 ],
[0.119708, 1.12792 ]],
[[0.130351, 1.2414 ],
[0.125514, 1.21064 ],
[0.137717, 1.11571 ],
...,
...
...,
[0.107973, 1.18854 ],
[0.136203, 1.0985 ],
[0.127934, 1.07662 ]],
[[0.122512, 1.19423 ],
[0.120131, 1.25898 ],
[0.13529 , 1.21686 ],
...,
[0.112599, 1.21695 ],
[0.128991, 1.11756 ],
[0.120421, 1.21239 ]],
[[0.135157, 1.19852 ],
[0.123128, 1.31142 ],
[0.125693, 1.10325 ],
...,
[0.108356, 1.17946 ],
[0.139036, 1.05028 ],
[0.126155, 1.1906 ]]]])array([[[0.0822489, 0.101957 ],
[0.0908424, 0.105442 ],
[0.0790525, 0.114561 ],
...,
[0.0797601, 0.100791 ],
[0.0821422, 0.105244 ],
[0.0846408, 0.115955 ]],
[[0.0725266, 0.118428 ],
[0.0856653, 0.107317 ],
[0.0794435, 0.103784 ],
...,
[0.0797231, 0.10365 ],
[0.0790131, 0.115766 ],
[0.0728859, 0.103274 ]],
[[0.0704429, 0.0955872],
[0.0762201, 0.101404 ],
[0.0777864, 0.0975832],
...,
[0.0697897, 0.0989847],
[0.0982069, 0.113484 ],
[0.0911951, 0.109216 ]],
[[0.0920115, 0.123187 ],
[0.0781625, 0.118374 ],
[0.0808318, 0.108663 ],
...,
[0.08323 , 0.110853 ],
[0.0744598, 0.0994558],
[0.0900424, 0.112892 ]]])array([[[0.306635, 0.124304, 0.187264, 0.187449],
[0.286909, 0.147922, 0.166726, 0.190717],
[0.276915, 0.12048 , 0.162898, 0.212989],
...,
[0.321445, 0.127057, 0.204801, 0.164379],
[0.318113, 0.115721, 0.202558, 0.169039],
[0.31647 , 0.122433, 0.211105, 0.169689]],
[[0.297267, 0.134288, 0.192437, 0.184753],
[0.283858, 0.144429, 0.16054 , 0.162777],
[0.289786, 0.162654, 0.167226, 0.162739],
...,
[0.304578, 0.12005 , 0.17476 , 0.181288],
[0.287762, 0.142238, 0.172456, 0.178528],
[0.339716, 0.135832, 0.168993, 0.17343 ]],
[[0.285628, 0.1227 , 0.173518, 0.187269],
[0.276321, 0.125936, 0.180225, 0.184253],
[0.277344, 0.135823, 0.175009, 0.172375],
...,
[0.304809, 0.136918, 0.189169, 0.190901],
[0.299019, 0.114388, 0.174784, 0.161724],
[0.299821, 0.1065 , 0.166271, 0.163633]],
[[0.285408, 0.135071, 0.168085, 0.191985],
[0.26943 , 0.119793, 0.174969, 0.165298],
[0.302355, 0.144855, 0.169773, 0.203015],
...,
[0.275712, 0.131327, 0.177422, 0.171892],
[0.276625, 0.126906, 0.164879, 0.176394],
[0.286202, 0.127272, 0.175298, 0.169607]]])array([[[0.318976, 0.222496, 0.42584 , 0.302836],
[0.253662, 0.390257, 0.180567, 0.330726],
[0.230381, 0.241223, 0.217702, 0.502735],
...,
[0.34939 , 0.262185, 0.50306 , 0.232261],
[0.316792, 0.190928, 0.495721, 0.22685 ],
[0.321898, 0.240568, 0.629856, 0.267154]],
[[0.262563, 0.417925, 0.454985, 0.319676],
[0.208755, 0.459501, 0.166922, 0.158623],
[0.263579, 0.659097, 0.233062, 0.166811],
...,
[0.3119 , 0.178675, 0.307761, 0.336946],
[0.234741, 0.345569, 0.260089, 0.309518],
[0.437672, 0.3568 , 0.286565, 0.238068]],
[[0.243934, 0.206862, 0.304474, 0.313173],
[0.201846, 0.24644 , 0.305891, 0.30215 ],
[0.21061 , 0.370489, 0.299667, 0.248502],
...,
[0.280318, 0.386046, 0.345576, 0.405493],
[0.266611, 0.222543, 0.281896, 0.15128 ],
[0.250772, 0.114651, 0.193003, 0.173167]],
[[0.235713, 0.461594, 0.225046, 0.408766],
[0.170918, 0.190902, 0.284127, 0.253047],
[0.303957, 0.48778 , 0.285659, 0.403643],
...,
[0.217653, 0.306445, 0.350783, 0.285101],
[0.191972, 0.290746, 0.22737 , 0.25613 ],
[0.235009, 0.24144 , 0.307302, 0.291231]]])array([[[0.547935, 0.503576, 0.679609, 0.646653],
[0.563138, 0.572273, 0.529156, 0.558468],
[0.595056, 0.529759, 0.48327 , 0.514301],
...,
[0.534353, 0.873891, 0.617499, 0.581924],
[0.518799, 0.868983, 0.69065 , 0.608035],
[0.543861, 0.765257, 0.631228, 0.628352]],
[[0.535384, 0.54318 , 0.553645, 0.487606],
[0.516527, 0.547299, 0.626518, 0.517061],
[0.538384, 0.543447, 0.645892, 0.618087],
...,
[0.554222, 0.681102, 0.647183, 0.588329],
[0.587063, 0.513616, 0.535311, 0.801104],
[0.609341, 0.505645, 0.692681, 0.731315]],
[[0.559536, 0.624334, 0.529274, 0.595203],
[0.549354, 0.625325, 0.550482, 0.601701],
[0.561578, 0.61799 , 0.485105, 0.539535],
...,
[0.530748, 0.598894, 0.522809, 0.639774],
[0.52055 , 0.527936, 0.584516, 0.638709],
[0.50738 , 0.574842, 0.621675, 0.654328]],
[[0.576698, 0.607796, 0.694155, 0.592173],
[0.510905, 0.649329, 0.571062, 0.713752],
[0.617933, 0.526595, 0.456563, 0.586946],
...,
[0.559447, 0.566116, 0.496751, 0.525666],
[0.524732, 0.722651, 0.590491, 0.713421],
[0.54931 , 0.594385, 0.516837, 0.656513]]])array([[[[[0.127353 , 1.22016 ],
[0.15424 , 1.20543 ],
[0.186704 , 1.18764 ],
...,
[2.14813 , 0.112907 ],
[2.25519 , 0.054248 ],
[2.31199 , 0.0231206 ]],
[[0.126321 , 1.2256 ],
[0.137249 , 1.2201 ],
[0.149114 , 1.21412 ],
...,
[0.510479 , 1.03215 ],
[0.553288 , 1.01059 ],
[0.599493 , 0.98732 ]],
[[0.136553 , 1.2528 ],
[0.152453 , 1.24199 ],
[0.170161 , 1.22996 ],
...,
...
...,
[0.439792 , 0.982459 ],
[0.476624 , 0.960567 ],
[0.516343 , 0.936959 ]],
[[0.139224 , 1.05019 ],
[0.154932 , 1.04207 ],
[0.172378 , 1.03305 ],
...,
[0.808993 , 0.704025 ],
[0.889967 , 0.662175 ],
[0.977118 , 0.617132 ]],
[[0.126328 , 1.19049 ],
[0.140655 , 1.18108 ],
[0.156579 , 1.17063 ],
...,
[0.744468 , 0.784673 ],
[0.820086 , 0.735029 ],
[0.901656 , 0.681478 ]]]]])PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
...
290, 291, 292, 293, 294, 295, 296, 297, 298, 299],
dtype='int64', name='draw', length=300))PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='ln_mu_max_z_dim_0'))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='ln_ks_z_dim_0'))
PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='ln_gamma_z_dim_0'))
PandasIndex(Index([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], dtype='int64', name='tube'))
PandasIndex(Index([1, 2], dtype='int64', name='species'))
PandasIndex(Index([0, 1], dtype='int64', name='sigma_y_dim_0'))
PandasIndex(Index([1, 2, 3, 4], dtype='int64', name='strain'))
PandasIndex(Index([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], dtype='int64', name='timepoint'))
<xarray.Dataset> Size: 2MB
Dimensions: (chain: 4, draw: 300, measurement: 160)
Coordinates:
* chain (chain) int64 32B 0 1 2 3
* draw (draw) int64 2kB 0 1 2 3 4 5 6 ... 293 294 295 296 297 298 299
* measurement (measurement) int64 1kB 1 2 3 4 5 6 ... 155 156 157 158 159 160
Data variables:
yrep (chain, draw, measurement) float64 2MB 0.2274 0.937 ... 0.9595
Attributes:
created_at: 2024-04-30T07:32:24.234666
arviz_version: 0.17.0
inference_library: cmdstanpy
inference_library_version: 1.2.1array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 297, 298, 299])
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
155, 156, 157, 158, 159, 160])array([[[0.227384, 0.936965, 0.436816, ..., 0.983157, 0.668725,
0.826308],
[0.261367, 1.15937 , 0.485356, ..., 0.927863, 0.810587,
0.949939],
[0.237106, 1.09835 , 0.396129, ..., 1.09271 , 0.679098,
0.777113],
...,
[0.209302, 1.18392 , 0.330663, ..., 0.818786, 0.827183,
0.718728],
[0.205393, 1.49241 , 0.397251, ..., 0.885399, 0.630624,
0.85129 ],
[0.209828, 1.01091 , 0.368422, ..., 0.794482, 0.651933,
0.791165]],
[[0.212651, 1.31444 , 0.372666, ..., 0.95774 , 0.686714,
0.985028],
[0.232429, 0.992496, 0.461549, ..., 0.965484, 0.846621,
0.868622],
[0.217889, 1.33868 , 0.410758, ..., 0.745689, 0.726656,
0.646724],
...
[0.201336, 1.15256 , 0.372924, ..., 1.1165 , 0.582028,
0.906945],
[0.219615, 1.09883 , 0.392869, ..., 0.835978, 0.641543,
0.798561],
[0.219139, 0.948146, 0.391069, ..., 0.902791, 0.734089,
0.859884]],
[[0.226279, 1.02197 , 0.413365, ..., 0.930944, 0.760439,
0.790015],
[0.214464, 1.36287 , 0.409723, ..., 0.960035, 0.747794,
0.935883],
[0.230627, 1.20867 , 0.391851, ..., 0.877454, 0.735588,
0.731156],
...,
[0.244746, 1.26408 , 0.43012 , ..., 0.797974, 0.715362,
0.756669],
[0.210013, 1.252 , 0.368124, ..., 0.842344, 0.768577,
0.746415],
[0.251364, 1.30447 , 0.44961 , ..., 1.05276 , 0.609121,
0.959459]]])PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
...
290, 291, 292, 293, 294, 295, 296, 297, 298, 299],
dtype='int64', name='draw', length=300))PandasIndex(Index([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
...
151, 152, 153, 154, 155, 156, 157, 158, 159, 160],
dtype='int64', name='measurement', length=160))<xarray.Dataset> Size: 2MB
Dimensions: (chain: 4, draw: 300, measurement: 160)
Coordinates:
* chain (chain) int64 32B 0 1 2 3
* draw (draw) int64 2kB 0 1 2 3 4 5 6 ... 293 294 295 296 297 298 299
* measurement (measurement) int64 1kB 1 2 3 4 5 6 ... 155 156 157 158 159 160
Data variables:
llik (chain, draw, measurement) float64 2MB 3.07 0.4682 ... 1.037
Attributes:
created_at: 2024-04-30T07:32:24.235885
arviz_version: 0.17.0
inference_library: cmdstanpy
inference_library_version: 1.2.1array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 297, 298, 299])
array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112,
113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126,
127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
155, 156, 157, 158, 159, 160])array([[[ 3.06974 , 0.468154 , 2.42202 , ..., -0.52844 ,
1.86399 , 0.785454 ],
[ 2.89394 , 0.836349 , 2.18481 , ..., 0.280494 ,
1.75281 , 0.486793 ],
[ 3.10592 , 0.605888 , 2.53602 , ..., 0.844739 ,
1.86992 , 0.201968 ],
...,
[ 2.94527 , 0.326955 , 2.57049 , ..., -0.570148 ,
1.55771 , 1.01998 ],
[ 2.90857 , 0.0470462, 2.53981 , ..., 0.119252 ,
1.75207 , 0.569022 ],
[ 2.81414 , 0.129617 , 2.50832 , ..., 0.361471 ,
1.35924 , 0.608006 ]],
[[ 3.18796 , 0.727392 , 2.54549 , ..., -0.341253 ,
1.40833 , 1.14795 ],
[ 3.012 , 0.206913 , 2.47588 , ..., -0.0408692,
1.73821 , 0.792903 ],
[ 2.9483 , -0.128337 , 2.23154 , ..., 1.16819 ,
1.89705 , -1.08372 ],
...
[ 2.97165 , 0.512323 , 2.70612 , ..., -0.579588 ,
0.778223 , 0.943887 ],
[ 2.89355 , 0.0899549, 2.28445 , ..., -0.0749024,
1.69561 , 0.725514 ],
[ 2.71393 , -0.192312 , 2.41595 , ..., 0.315336 ,
1.70167 , 0.350371 ]],
[[ 2.8408 , 0.418232 , 2.41493 , ..., -0.16898 ,
1.25455 , 1.03437 ],
[ 3.01917 , 0.336305 , 2.30847 , ..., -0.505104 ,
1.8999 , 0.996751 ],
[ 3.05213 , 1.03249 , 2.19536 , ..., 1.16087 ,
1.85772 , -0.841761 ],
...,
[ 2.98202 , 0.844719 , 2.31255 , ..., 0.603364 ,
1.32581 , 0.496724 ],
[ 3.00547 , 0.236982 , 2.62469 , ..., -0.193662 ,
1.87816 , 0.37846 ],
[ 2.77859 , 0.276103 , 1.99299 , ..., -0.413784 ,
1.18399 , 1.03708 ]]])PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
...
290, 291, 292, 293, 294, 295, 296, 297, 298, 299],
dtype='int64', name='draw', length=300))PandasIndex(Index([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
...
151, 152, 153, 154, 155, 156, 157, 158, 159, 160],
dtype='int64', name='measurement', length=160))<xarray.Dataset> Size: 61kB
Dimensions: (chain: 4, draw: 300)
Coordinates:
* chain (chain) int64 32B 0 1 2 3
* draw (draw) int64 2kB 0 1 2 3 4 5 6 ... 294 295 296 297 298 299
Data variables:
lp (chain, draw) float64 10kB 98.7 100.3 98.41 ... 107.8 99.97
acceptance_rate (chain, draw) float64 10kB 0.8923 0.9493 ... 0.9548 0.6988
step_size (chain, draw) float64 10kB 0.02326 0.02326 ... 0.02116
tree_depth (chain, draw) int64 10kB 8 8 7 7 7 8 7 7 ... 8 8 7 7 7 8 8
n_steps (chain, draw) int64 10kB 255 255 127 255 ... 127 255 255
diverging (chain, draw) bool 1kB False False False ... False False
energy (chain, draw) float64 10kB -70.99 -70.01 ... -83.65 -75.14
Attributes:
created_at: 2024-04-30T07:32:24.232711
arviz_version: 0.17.0
inference_library: cmdstanpy
inference_library_version: 1.2.1array([0, 1, 2, 3])
array([ 0, 1, 2, ..., 297, 298, 299])
array([[ 98.6994, 100.282 , 98.4108, ..., 94.3663, 95.6063, 98.9217],
[101.716 , 101.835 , 99.2573, ..., 113.606 , 104.797 , 108.535 ],
[104.881 , 116.195 , 104. , ..., 103.933 , 91.8939, 98.9594],
[ 99.8044, 93.0295, 91.9602, ..., 102.789 , 107.759 , 99.965 ]])array([[0.892305, 0.949287, 0.988558, ..., 0.872621, 0.998322, 0.544854],
[0.998353, 0.923934, 0.998974, ..., 0.962084, 0.995258, 0.990927],
[0.993958, 0.990483, 0.987299, ..., 0.959857, 0.888056, 0.871114],
[0.997017, 0.998715, 0.970947, ..., 0.995319, 0.954803, 0.698783]])array([[0.0232577, 0.0232577, 0.0232577, ..., 0.0232577, 0.0232577,
0.0232577],
[0.026324 , 0.026324 , 0.026324 , ..., 0.026324 , 0.026324 ,
0.026324 ],
[0.0234513, 0.0234513, 0.0234513, ..., 0.0234513, 0.0234513,
0.0234513],
[0.0211602, 0.0211602, 0.0211602, ..., 0.0211602, 0.0211602,
0.0211602]])array([[8, 8, 7, ..., 7, 7, 7],
[7, 7, 7, ..., 7, 7, 7],
[8, 7, 7, ..., 7, 7, 7],
[7, 7, 8, ..., 7, 8, 8]])array([[255, 255, 127, ..., 127, 127, 127],
[127, 127, 127, ..., 255, 127, 255],
[255, 127, 127, ..., 127, 127, 127],
[255, 255, 255, ..., 127, 255, 255]])array([[False, False, False, ..., False, False, False],
[False, False, False, ..., False, False, False],
[False, False, False, ..., False, False, False],
[False, False, False, ..., False, False, False]])array([[-70.9876, -70.0079, -74.0583, ..., -64.4323, -66.379 , -68.7524],
[-71.7556, -75.488 , -72.4687, ..., -88.9214, -84.9861, -86.2475],
[-82.8876, -85.5851, -86.2919, ..., -77.9567, -78.2329, -66.4122],
[-78.5389, -65.0723, -65.1918, ..., -74.4399, -83.6473, -75.1433]])PandasIndex(Index([0, 1, 2, 3], dtype='int64', name='chain'))
PandasIndex(Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
...
290, 291, 292, 293, 294, 295, 296, 297, 298, 299],
dtype='int64', name='draw', length=300))First check the sample_stats group to see if there were any divergent transitions and if the lp parameter converged.
/home/nicholas/courses/bayesian_statistics_for_computational_biology/.venv/lib/python3.12/site-packages/arviz/stats/diagnostics.py:592: RuntimeWarning: invalid value encountered in scalar divide
(between_chain_variance / within_chain_variance + num_samples - 1) / (num_samples)
| mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
|---|---|---|---|---|---|---|---|---|---|
| lp | 102.940 | 5.559 | 92.235 | 112.809 | 0.246 | 0.174 | 516.0 | 819.0 | 1.000000e+00 |
| acceptance_rate | 0.937 | 0.087 | 0.775 | 1.000 | 0.002 | 0.002 | 1226.0 | 1063.0 | 1.000000e+00 |
| step_size | 0.024 | 0.002 | 0.021 | 0.026 | 0.001 | 0.001 | 4.0 | 4.0 | 5.859337e+15 |
| tree_depth | 7.300 | 0.458 | 7.000 | 8.000 | 0.118 | 0.085 | 15.0 | 15.0 | 1.200000e+00 |
| n_steps | 186.200 | 64.273 | 127.000 | 255.000 | 15.662 | 11.272 | 17.0 | 17.0 | 1.170000e+00 |
| diverging | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 | 1200.0 | 1200.0 | NaN |
| energy | -76.800 | 7.424 | -89.448 | -62.775 | 0.349 | 0.247 | 451.0 | 754.0 | 1.000000e+00 |
Next check the parameter-by-parameter summary
| mean | sd | hdi_3% | hdi_97% | mcse_mean | mcse_sd | ess_bulk | ess_tail | r_hat | |
|---|---|---|---|---|---|---|---|---|---|
| ln_mu_max_z[0] | 1.977 | 0.460 | 1.155 | 2.877 | 0.019 | 0.013 | 602.0 | 819.0 | 1.00 |
| ln_mu_max_z[1] | -1.284 | 0.482 | -2.114 | -0.336 | 0.020 | 0.014 | 560.0 | 719.0 | 1.01 |
| ln_mu_max_z[2] | -0.091 | 0.473 | -0.966 | 0.857 | 0.018 | 0.013 | 655.0 | 800.0 | 1.00 |
| ln_mu_max_z[3] | -0.026 | 0.466 | -0.836 | 0.812 | 0.021 | 0.015 | 518.0 | 736.0 | 1.01 |
| ln_ks_z[0] | -0.157 | 0.748 | -1.705 | 1.112 | 0.022 | 0.020 | 1113.0 | 916.0 | 1.00 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| abundance[16, 18, 2] | 0.746 | 0.046 | 0.662 | 0.834 | 0.001 | 0.001 | 1549.0 | 1064.0 | 1.00 |
| abundance[16, 19, 1] | 0.877 | 0.039 | 0.804 | 0.953 | 0.001 | 0.001 | 1313.0 | 1050.0 | 1.00 |
| abundance[16, 19, 2] | 0.695 | 0.049 | 0.610 | 0.790 | 0.001 | 0.001 | 1521.0 | 1064.0 | 1.00 |
| abundance[16, 20, 1] | 0.968 | 0.045 | 0.885 | 1.058 | 0.001 | 0.001 | 1237.0 | 1046.0 | 1.00 |
| abundance[16, 20, 2] | 0.639 | 0.052 | 0.548 | 0.739 | 0.001 | 0.001 | 1483.0 | 1095.0 | 1.00 |
704 rows × 9 columns
Show posterior intervals
prior_abundances = idata_posterior.posterior["abundance"]
n_sample = 20
chains = rng.choice(prior_abundances.coords["chain"].values, n_sample)
draws = rng.choice(prior_abundances.coords["draw"].values, n_sample)
f, axes = plot_sim(true_abundance, fake_measurements, species_to_ax)
for ax, species_i in zip(axes, species):
for tube_j in tubes:
for chain, draw in zip(chains, draws):
timeseries = prior_abundances.sel(chain=chain, draw=draw, tube=tube_j, species=species_i)
ax.plot(
timepoints.values,
timeseries.values,
alpha=0.5, color="skyblue", zorder=-1
)
f.savefig("img/monod_posteriors.png")The next few cells use arviz’s plot_posterior function to plot the marginal posterior distributions for some of the model’s parameters:
f, axes = plt.subplots(1, 4, figsize=[10, 4])
axes = az.plot_posterior(
idata_posterior,
kind="hist",
bins=20,
var_names=["gamma"],
ax=axes,
point_estimate=None,
hdi_prob="hide"
)
for ax, true_value in zip(axes, true_param_values["gamma"]):
ax.axvline(true_value, color="red")